Crunch Time Flashcards
C build process: purpose of the Preprocesspr?
takes .c file, outputs .i preprocessed file
strips comments
makes substitutions for # (expand macros)
parse c code into pure c code with no preprocessor directives
C build process: what is the purpose of the compiler?
takes .i file, outputs .s or .asm file
tests for semantic errors
decompose/split operations into assembly operations
Front End:
- parse/tokenize keyworse, identifiers, operators and literals.
- checks for compiler syntax errors
- checks for semantic error (undeclared variable usage, incompatible types, variable out of scope)
- uses symbol table to confirm which symbols are legal to use, when used
Back End:
- Optimization
- generates assembly code from pure C code
C Build process: what is the purpose of the Assembler?
takes .asm file, outputs .o file (containing opcodes and data sections)
adds the following to object file:
- sections for static variables,
- symbol table, to store variable names and attributes
- debug info, maps source code and information needed by debugger
- export section; global symbols/functions/variables
- imports section, containing symbol names needed from other object files
C build process: what is the purpose of the Linker?
takes .o file, outputs relocatable file
Symbol Resolution
- resolves external references (that were marked by assembler), throws “unresolved reference to variable” if not found.
Relocation
- changes addresses assigned to labels because Section Merging and Section Placement
Section Merging:
- merges sections from input files into sections of output file
Section Placement
- assembled program assumes each section starts from address 0; if not, these need to be moved to reflect that
C Build Process: what is the purpose of the Locator?
takes relocateable file and linker script file, into executeable file
memory layout information - (flash/sram, placement of different program regions) -
is provided by linker script file, locator performs conversion to generate single, executeable binary image
Internet
Infranet
globally linked computer netowrk using TCP/IP protocol to communicate
privately owned/controlled network, usually on a client/server platform to share files/data locally
OSI Model
First standard model for network communication:
Application
Presentation
Session
Transport
Network
Data Link
Physical
IPV4,
Exhaustioned solutions
IPv4 was built for roughly 4.29 billion IPv4 addresses… and we are running out.
solutions:
Network Interface Card NIC
uses physical layer circuitry to communicate with data-link layer to provide a computer with a connection to the/a network
Ethernet
tech that connects devices in a LAN or WAN. enabled device comunication within a protocol
Hub
Broadcasts data to every computer/Ethernet based device connected to it.
Switch (Filtering, Forwarding)
smart switch; implements forwarding ro known destination MAC addresses, and filters packets
ARP
Address Resolution Protocol maps IP address to MAC addresses
Network types (LAN, WAN)
…really..?
IP addresses (Net ID, Host ID, subnet mask)
identifies device on network.
Net id identifies the host’s network,
host ID identifies the host’s TCP/IP network
subnet mask divides an IP address into two parts:
IP Address Classes
A: first 8 leading bits
B: first 16 leading bits
C: first 24 leading bits
D: for multitask aplications
E: undefined, for testing or illegal
CIDR
classless inter-domain routing
IP address Allocation Method, allows more flexibility than classful (A/B/C) adressing. (can create /23 leading bits and form subnets/vlans)
vLAN
devices/nodes communicated as if they were in a single lan… or formed under an existing LAN
NAT
Network Address Translation
PAT
maps private addresses (internal IP) in a LAN to a public IP address,
VPN
Port Address Translation, extension of NAT,
devices in LAN mapped to a single IP addresses using port numbers
UDP/TCP
Port
virtual point where connection starts and ends
Socket
endpoint of a two-way communication between two programs on a network. (virtual file, written to, read from)
DHCP
dynamic host configuration protocol
client-server protocol in which servers manage a pool of unique IP addresses, as well as information about client configuration parameters. The servers then assign addresses out of those address pools. DHCP-enabled clients send a request to the DHCP server whenever they connect to a network
Describe the OSI Model. Give examples of Protocls in Layers
Explain the IPv4 address exhaustion, and its solutions today
What are the differences between a switch and a hub?
What are the differences between LAN and WAN?
Explain the need for IP addresses. Why are MAC addresses not sufficient?
What are the differences between broadcast, multicast and unicast?
What is ARP? ARP Cache? Gratioutous ARP?
Address Resolution protocol: map IP to Mac address
collection of ARP entries created when an ARP resolves a mac/ip connection
node broadcasts to netwrok to update its mapping
What are the differences between UDP and TCP, and what are the advantages of each? when would we use each? which is safer? faster?
What does a port number mean, and what is it used for?
ID’s the process where data should be sent to
what is the command used to show all open ports and/or sockets on a machine?
sydo netstat -tulpn | grep LISTEN
-p dispplays pd
-n: don’t resolve names
What is DHCP? which service provides DHCP in a home LAN?
provided by broadband/cable router, provides IP address to IP host
What is a subnet mask and what is it used for?
assigns additional noodes/devices under a single IP address
if you set a system’s subnet mask to 255.255.255.0, how many computers can you put in a network without using a router?
254
two reserved for network identifier and network broadcast. in this case broadcast is not in use
given a network address 10.0.16.0/24, detect which of the following is a host IP: 10.0.17.50, 10.0.9.16, 10.0.16.31, or 10.0.0.16
10.0.16.31
MAC Address:
Media Accesss Control Address. unique id assigned to NIC