Download Network Layer Exam Questions and Answers: Chapter 4 to 5 and more Exams Advanced Education in PDF only on Docsity!
NETWORK LAYER CHAPTER 4 TO
5 EXAM QUESTIONS WITH CORRECT
ANSWERS 100% 2024
What is the main role of the network layer and its two functions? - CORRECT ANSWERS-Transport segment from sending host to receiving host. At sender: encapsulate segments into datagrams and pass to link layer. At receiver: deliver segments to transport layer.
- Forwarding: move packets from a router's input link to appropriate router output link.
- Routing: determine route taken by packets from source to destination What are the main functions of a router? - CORRECT ANSWERS-- Examines header fields in all IP datagrams passing through it
- Moves datagrams from input ports to output ports to transfer datagrams along end-end path What are the two planes of the network layer? What are their functions? - CORRECT ANSWERS-Data plane: local, per-router function, determines how datagram arriving on router input port is forwarded to router output port. Control plane: network-wide logic (routing algorithms), determines how datagram is routed among routers along end-end path from source host to destination host What are the two control plane implementation approaches? - CORRECT ANSWERS-
- Per-router control plane: traditional routing algorithms, individual routing algorithm components in each and every router interact in the control plane.
- software-defined networking (SDN) control plane: implemented in (remote) servers, remote controller computers installs forwarding tables in routers What are the main parts (architecture) of a generic router? - CORRECT ANSWERS- Routing, management control plane (software): operates in ns time frame
- routing processor: run routing algorithms Forwarding data plane (hardware): operates in ns time frame
- router input ports: line termination, link layer protocol (receive), lookup, forwarding, queueing
- high-speed switching fabric: transfer packet from input link to appropriate output link
- router output ports: datagram buffer, queueing, link layer protocol (send), line termination What are the input port functions of a router? - CORRECT ANSWERS-physical layer: bit-level reception link layer: e.g. Ethernet
network layer: decentralized switching
- Using header field values, lookup output port using forwarding table in input port memory.
- goal: complete input port processing at 'line speed'
- input port queueing: if datagrams arrive faster than forwarding rate into switch fabric
- destination-based forwarding: forward based only on destination IP address (traditional) What are the functions of switching fabrics in a router? - CORRECT ANSWERS-transfer packet from input link to appropriate output link switching rate: rate at which packets can be transferred from inputs to outputs, measured as multiple of input/output line rate. Desirable switching rate for N inputs = N*line rate What are the 3 major types of switching fabrics? - CORRECT ANSWERS-1. Switching via memory
- packet copied to system's memory, then copied to output.
- used by first generation routers or traditional computers with switching under direct control of CPU CON: speed limited by memory bandwidth, need 2 bus crossings per datagram
- Switching via bus
- check local forwarding table
- send packet over bus, where every output port can have access to it (broadcast transmission)
- the corresponding output port will copy the packet CON: can only switch 1 packet at a time to avoid data collision, switching speed limited by bus bandwidth
- Switching via interconnection network
- multiple buses in Crossbar, Clos networks, or other interconnection nets
- initially developed to connect processors in multiprocessor
- multistage switch: nxn switch from multiple stages of smaller switches PROS: exploits parallelism (fragment datagram into fixed length cells on entry, switch cells through the fabric, and reassemble datagram at exit) How does router input port queueing work? - CORRECT ANSWERS-- If switch fabric is slower than input ports combined (N*R > R_s) -> queueing delay and loss due to input buffer overflow
- Head-of-the-Line (HOL) blocking: queued datagram at from of queue prevents others in queue from moving forward (FIFO) How does router output port queueing work? - CORRECT ANSWERS-- Buffering required when datagrams arrive from fabric faster than link transmission rate
- Drop policy is followed to decide which datagrams to drop if no free buffers
- Scheduling discipline chooses among queued datagrams for transmission (priority scheduling)
PRO: priority scheduling used to achieve quality of service. Determines who gets best performance, or ensures network neutrality (all data treated equally) CON: queueing delay + loss due to congestion or output port buffer overflow What are some network layer functions and protocols? - CORRECT ANSWERS-- Path- selection algorithms: implemented in routing protocols (OSPF, BGP) and SDN controller, produces forwarding tables
- Internet Protocol (IP): defines datagram format, addressing, and packet handling conventions
- Internet Control Message Protocol (ICMP): error reporting, router "signaling" What is the IP datagram format? - CORRECT ANSWERS-- IP protocol version number (4 bit)
- header length in bytes (4 bits)
- type of service, DSCP (Differentiated Services Code Point) (8 bits)
- packet length in bytes (header + data) (16 bits)
- 16-bit ID = fragmented small packets carry the same ID
- 3-bit flags: <not used, Don't frag., More frags to follow>
- fragment offset * 8 = position of the fragment in the original packet
- TTL = max number of remaining hops (8-bit)
- Upper layer: the upper layer protocol to deliver payload (TCP = 6, UDP = 17) (8 bit)
- Header checksum = to detect bit errors in packet header (16-bit)
- Source IP address (32-bit)
- Destination IP address (32-bit)
- options, if any
- data How does IP fragmentation and reassembly work? What are the IP header fields used for fragmentation? - CORRECT ANSWERS-- Network links have MTU (maximum transfer size) - largest possible link-level frame
- Large IP datagram divided ("fragmented") within the net, and "reassembled" only at final destination
- IP header bits are used to identify, order related fragments ID: fragments from the same packet will have same ID flags: Don't frag, More frags to follow = tell if this is the last fragment fragment offset = position of fragment in the original packet (in multiple of 2^3 bytes) What is an IP address? - CORRECT ANSWERS-A 32-bit identifier associated with each host or router interface IP address = subnet || host ID What is a network interface? - CORRECT ANSWERS-A connection between host or router and physical link
- routers typically have multiple interfaces
- hosts typically have one or two interfaces (wired Ethernet + wireless 802.11)
What is a subnet? - CORRECT ANSWERS-A subnet is a part of a network where device interfaces can physically reach each other without passing through an intervening router.
- Detach each interface from its host or router, each island of isolated network is a subnet.
- Devices in the same subnet have common higher order bits, the remaining low order bits are the host part. What is Classful addressing? - CORRECT ANSWERS-Classful addressing used from 1981 to 1993, characterized by fixed length prefixes Class A: address begins with 0, prefix length = 8 bits (Prefix. Host. Host. Host) Class B: address begins with 10, prefix length = 16 bits (Prefix. Prefix. Host. Host) Class C: address begins with 110, prefix length = 24 bits (Prefix. Prefix. Prefix. Host) Class D: begins with 1110 Class E: begins with 1111 ***drawback: fixed number of bits for subnet and host, fixed number of networks and fixed number of addresses per network What is the IP addressing that we currently use? - CORRECT ANSWERS-Classless addressing: CIDR (Classless Inter Domain Routing)
- subnet portion of address is of arbitrary length
- address format is "a.b.c.d/x", where x is the # of bits in the subnet portion of the address Example: 129.9.0.0/ Network Mask = 255.255.0. router notation: 129.97.0.0/255.255.0. What are the network ID and broadcast address? - CORRECT ANSWERS-- Network ID (Subnet ID): appears in routing tables, the subnet part of the IP address + host part all set to zero
- Broadcast address: used to perform IP-level broadcasting (within the same subnet) Example: network: 10.2.5.16/ subnet mask = 255.255.255. Subnet ID = 10.2.5.16 (first addr in the net) Router IP = 10.2.5. Host IPs = 10.2.5.18 ~ 10.2.5. Broadcast addr = 10.2.5.31 (last addr in the net) How does a host get an IP address within its network? (host part of address) - CORRECT ANSWERS-1. hard-coded by sysadmin in config file (static IP address)
- DHCP (Dynamic Host Configuration Protocol): host dynamically obtains IP address from network server when it "joins" the network.
- can renew its lease on an address in use
- allow reusing addresses (host only holds an address when it is connected/on)
- supports mobile users who join/leave the network
How does DHCP work when an arriving client needs an address? - CORRECT ANSWERS-DHCP ports: server = 67, client = 68
- host broadcasts DHCP discover message (optional)
- source IP: 0.0.0.0, port 68
- dest IP: 255.255.255.255, port 67
- yiaddr: 0.0.0.
- transaction ID: 654
- DHCP server responds with DHCP offer message (optional)
- source IP: DHCP server IP, port 67
- dest IP: 255.255.255.255, port 68
- yiaddr: 223.1.2.4 (free IP address)
- transaction ID: 654
- host requests IP address: DHCP request message
- source IP: 0.0.0.0, port 68
- dest IP: 255.255.255.255, port 67
- yiaddr: 223.1.2.
- transaction ID: 655
- DHCP server allocates address: DHCP ack message
- source IP: DHCP server IP, port 67
- dest IP: 255.255.255.255, port 68
- yiaddr: 223.1.2.
- transaction ID: 656 *typically, DHCP server will be co-located in router, serving all subnets to which the router is attached *the first 2 steps can be skipped if a client remembers and wishes to reuse a previously allocated network address. What are the 4 pieces of information that a host can get from DHCP? - CORRECT ANSWERS-1. IP address on the subnet
- address of first-hop router for the client
- name and IP address of DNS server
- Network mask (indicating the network portion of the address) How does a network get IP address for itself? How does an ISP get a block of addresses? (network part of address) - CORRECT ANSWERS-A network gets an allocated portion of its provider ISP's address space ICANN (Internet Corporation for Assigned Names and Numbers)
- allocates IP addresses, through 5 regional registries (RRs) who allocate to local registries...
- also manages DNS root zone, including delegation of individual TLD management (e.g. .com, .edu, ...) Are there enough 32-bit IP addresses? - CORRECT ANSWERS-No! ICANN allocated the last chunk of IPv4 addresses in 2011
- use NAT toe help address space exhaustion
- use IPv6, with 128-bit address space
What is packet forwarding? How does a router choose the next hop? - CORRECT ANSWERS-- Packet forwarding is the relaying of packets from one physical interface to another by routers on the Internet.
- Routers use table-driven routing (as opposed to source routing = entire route in header), which uses the destination address in the packet, and the routing table in the router to find the next hop What is the basic structure of a routing table? - CORRECT ANSWERS-Fields: Dest. Address, Mask, Next hop, interface, Metric Types:
- addresses leaned by running routing protocols
- network addresses directly connected to the router (configured)
- default entry (configured) How does a router choose the next hop for a packet based on the routing table? - CORRECT ANSWERS-Address matching (longest prefix matching): if the dest. addr matches with an entry in the RT, choose the corresponding interface
- Compare IP with subnet ID (only the subnet part), find matching entry If (dest IP && subnet mask) == (entry IP && subnet mask), matching occurs
- Find IP of next hop, forward to that interface How does a router process an incoming packet that needs to be forwarded? - CORRECT ANSWERS-1. extract IP address from packet header (IP1) and compare it with routing table (RT)
- if matching occurs between IP1 and RT: find the matching entry with the longest prefix and forward the packet via the appropriate interface
- if matching does not occur, and if default entry exists in RT: forward the packet via the appropriate interface to the default entry
- if matching does not occur and default entry does not exist: send error message (ICMP) to the source of the IP packet What is Longest prefix matching and how does it work? - CORRECT ANSWERS- Longest prefix matching: when looking for forwarding table entry for given destination address, use longest address prefix that matches destination address Example: RT: 200.23.00010xxx.x = 0 200.23.00011000.x = 1 200.23.00011xxx.x = 2 otherwise = 3 Destination IP: 200.23.00010110.161 = 0 200.23.00011000.170 = 1 (longer prefix than 2) How does hierarchical addressing work? - CORRECT ANSWERS-Hierarchical addressing uses route aggregation to allow efficient advertisement of routing information. (combine 8 routes addresses into 1 route)
- A provider ISP gets allocated a set of IP addresses from ICANN
- The ISP allocates portions of its address space to organizations. What is another name for Address aggregation and how does it work? - CORRECT ANSWERS-Address aggregation is also called supernetting
- If entries on a RT cover all possible combination of a certain number of lower order bits, they can be combined into one longest common address, and advertised as one summary address. Example: 192.168.0.0/24 + 192.168.1.0/24 + 192.168.2.0/24 + 192.168.3.0/24 = 192.168.0.0/ What is NAT? - CORRECT ANSWERS-NAT (network Address translation) is when all devices in a local network share just one IPv4 address as far as outside world is concerned.
- It is done by a router who converts between public and private IP address.
- All devices in local network have 32-bit addresses in a private IP address space (prefix = 10/8, 172.16/12, or 192.168/16) that can only be used in the local network PROS:
- just one IP address is needed from an ISP for all devices on the local network
- can change addresses of hosts in local network without notifying the outside world
- can change ISP without changing addresses inside local network
- devices in different homes (local networks) can have Identical IPs
- security: devices inside the local network is not directly addressable/visible by outside world How is a NAT router implemented? how does the NAT work in action? - CORRECT ANSWERS-NAT router:
- outgoing datagrams: replace (source IP, port #) of every outgoing datagram to (NAT IP, new port #). new port # is randomly generated.
- remember/record in NAT translation table every (Source IP, port #) to (NAT IP, new port #) translation pair
- incoming datagrams: replace (NAT IP, new port #) in destination field of every incoming datagram with corresponding (source IP, port #) stored in NAT table NAT translation table: WAN side addr (Internet), LAN side addr (private) Why is NAT controversial? - CORRECT ANSWERS-- routers should only have up to 3 layers, NAT needs transport layer
- address shortage problem should be solved by IPv
- the existence of NAT violates the end-to-end argument of protocols such as TCP, because the port # is manipulated by this network layer device *However, NAT is here to stay and extensively used in home and institutional nets, G/5G cellular nets What is the goal of routing protocols? - CORRECT ANSWERS-Determine "good" paths (routes) from sending host to receiving host through a network of routers
- path = sequence of routers that packets traverse from a given initial source host to final destination host
- "good" = least cost, fastest, or least congested What abstraction do we use to solve routing algorithm problems? How is the cost of the link defined - CORRECT ANSWERS-Graph abstraction with link costs
- graph: G = (N, E) e.g. N: set of routers = {u, v, w, x} E: set of links = {(u, v), (u, w), (v, w), (v, x)}
- c_a,b = cost of a direct link connecting a and b Cost is defined by network operator:
- always 1
- inversely related to bandwidth
- inversely related to congestion How are routing algorithms classified? - CORRECT ANSWERS-Global vs. decentralized information
- Global: all routers have complete topology and link cost info of the network, each router has full exact image of network (e.g. link state" algorithms)
- Decentralized: iterative process of computation and exchange of info with neighbors. routers initially only know link costs to attached neighbors, each router build an approximate image based on what other routers share (e.g. distance vector algorithms) How fast do routers change
- static: routes change slowly over time (cost of links static too)
- dynamic: routes change more quickly by periodic updates or in response to link cost changes What are the two main types of routing algorithms that we study? - CORRECT ANSWERS-1. Dijkstra's link-state algorithm: centralized, iterative, computes least cost paths from one node (source) to all other nodes (forwarding table at source)
- Distance vector algorithms, based on Bellman-Ford (BF) equation: iterative, asynchronous, distributed (decentralized), self-stopping How does Dijkstra's link-state routing algorithm work? - CORRECT ANSWERS- Notations:
- c_x,y = direct link cost from node x to y (= inf. if not direct neighbors)
- D(v) = current estimate of cost of least-cost-path from source to destination v
- p(v) = predecessor node along path from source to v
- N' = set of nodes whose least-cost-path is definitively known Algorithm:
- Initial step:
- N' = {u (source node)}
- For all nodes v, if v is adjacent to u, then D(v) = c_u,v and p(v) = u.
- If not adjacent, D(v) = inf.
- For all remaining steps, loop:
- Find w not in N' such that D(w) is minimum compared to all other nodes v, add w to N'
- update D(v) for all v adjacent to w and not in N': D(v) = min (D(v), D(w) + c_w,v)
- end when all nodes are in N'
- if ties occur, pick any node with least cost path What is the Bellman-Ford (BF) equation? - CORRECT ANSWERS-Let D_x(y) = cost of least-cost-path from x to y D_x(y) = min_v{c_x,v + D_v(y)}
- take the minimum over all v (neighbors of x) of the direct cost of link from x to v + v's estimate least-cost-path cost to y Example: suppose u's neighboring nodes, x, v, w, knoe that for destination z, D_v(z)=5, D_w(z)=3, D_x(z)=3, and c_u,v=2, c_u,w=5, c_u,x= D_u(z) = min{5+2, 3+5, 3+1} = 4 The next hop is the node achieving minimum, which is x in this case. How does Distance Vector Algorithm work? - CORRECT ANSWERS-- From time-to- time, each node sends its own distance vector estimate to neighbors (when its own DV changes)
- when x receives a new DV estimate from any neighbor, it updates its own DV using the BF equation for each node
- Under minor, natural conditions, the estimate D_x(y) will converge to the actual least cost Each node's algorithm:
- wait for change in local link cost or update message from a neighbor
- recompute the DV estimates using the DV received from neighbor
- if DV to any destination has changed, notify neighbors What are the 4 properties/PROs/features of Distance vector algorithm? - CORRECT ANSWERS-1. iterative: each node performs the same iterative task to compute/update DVs.
- asynchronous: each iteration triggered by a local link cost change or a received update message
- distributed: each node calculate its own DV, no centralized calculator.
- self-stopping: each node notifies neighbors only when its DV changes, and neighbors notify their neighbors only if necessary. If no notification received, no actions will be taken! What is state information diffusion associated with the distance vector algorithm? - CORRECT ANSWERS-State information diffusion: use iterative communication and each computation step diffuses information through the network. Example: info = c's state t=0, info at c only t=1, info propagate and influence DV computations up to 1 hop away from c ... t=4, info may influence DV computations up to 4 hops away from c
What are the pros and cons of Distance vector algorithm when a link cost changes? - CORRECT ANSWERS-"good news travels fast"
- if cost of a link becomes smaller, the node who detects the local link cost change will update its routing info, recalculate local DVs, and notify its neighbors "bad news travels slow" - count-to-infinity problem
- if cost of a link becomes larger, the node who detects the local link cost change will update its info based on its neighbor, who may have a smaller cost based on previous non-updated info.
- Count to infinity problem (AKA routing loop): two nodes update each other's DV to another destination based on old info, until it reaches infinity (if link failed) or to the new larger link cost. What are two solutions to the routing loop problem? What are their limitations? - CORRECT ANSWERS-X --x-- A ----- B
- split horizon: if node B learns about a path to X from A, node B will not tell A about this path
- Poisoned reverse: if A tries to route to X via B, A tells B that it has an infinity-cost path to X when the (X, A) link is broken Limitation: this only solves two-node instability, and does not solve the loop problem for three or more nodes! What is the Internet's approach to scalable routing? - CORRECT ANSWERS-Aggregate routers into regions known as "autonomous systems" (AS) (AKA domains)
- Intra-AS (intra-domain): all routers in same AS must run same intra-domain protocol, routers in different AS can run different intra-domain routing protocols
- Gateway router: at the edge of its own AS and has links to routers in other AS
- inter-AS (interdomain): gateway routers perform inter-domain routing as well as intra domain routing *This approach gives scalability of billions of destinations, and administrative autonomy to each network admin to control routing in its own network. How are forwarding tables configured by intra- and inter-AS routing algorithms? - CORRECT ANSWERS-1. Intra-AS routing algorithms determined entries for destinations within the AS
- Both Inter-AS and Intra-AS routing algorithms determine entries for external destinations What role does inter-AS routing play in intra-domain forwarding? - CORRECT ANSWERS-For AS1, who is connected to AS2 and AS Inter-domain routing must learn which destinations are reachable through AS2 and AS3, and propagate this reachability information to all routers within AS What are 3 most common intra-AS routing protocols? - CORRECT ANSWERS-- RIP (Routing Information Protocol): classic distance vector, DVs exchanged every 30 sec, no longer widely used
- EIGRP (Enhanced Interior Gateway Routing Protocol): DV based, formerly Cisco proprietary
- OSPF (Open Shortest Path First): link-state routing, essentially same as IS-IS protocol (ISO standard) What is OSPF and how does it work? - CORRECT ANSWERS-OSPF (Open Shortest Path First) routing: publicly available (RFC) classic link-state algorithm
- each router floods OSPF link-state advertisements (directly over IP) to all other routers in the entire AS
- multiple link costs metrics can be possible used: bandwidth, delay, etc.
- each router has full topology of the network, uses Dijkstra's algorithm to compute forwarding table
- security: all OSPF messages are authenticated to prevent malicious intrusion What is hierarchical OSPF and what is its topology? - CORRECT ANSWERS-two-level hierarchy: local area, backbone
- link-state advertisements flooded only in local area, or only in backbone
- each node has detailed area topology, and only knows direction to reach other destinations
- local routers: flood link-state in area only, compute routing within the area, and forward packets to outside via area border router
- area border router: summarizes distances to destinations in its own area, and advertise in backbone
- backbone router: runs OSPF limited to backbone
- boundary router: connects backbone routers to other AS What protocol does the Internet use for inter-AS routing? - CORRECT ANSWERS-BGP (Border Gateway protocol): the glue that holds the internet together, allows subnets to advertise their existence and the destinations that it can reach to the rest of the Internet
- eBGP (extrinsic): obtain subnet reachability information from neighboring AS
- iBGP (intrinsic): propagate reachability information to all AS-internal routers BGP provides AS a way to determine "good" routes to other network based on reachability information and policy *gateway routers run both eBGP and iBGP protocols What does BGP use to advertise a route? - CORRECT ANSWERS-advertised route = prefix (subnet) + attributes prefix = destination being advertised (the subnet) important attributes:
- AS-PATH = list of ASes through which prefix advertisement has passed
- NEXT-HOP: the specific internal-AS router to the next hop AS in AS path Policy-based routing:
- each AS has its own routing policy
- gateway receiving route advertisement uses import policy to accept of decline a path (iBGP)
- AS policy also determines whether to advertise path to other neighboring ASes (eBGP) What does BGP use to select a route when more than one routes are available to a destination AS? - CORRECT ANSWERS-1. policy decision: local preference value attribute
- shortest AS-PATH (for gateway routers)
- closest NEXT-HOP router: hot potato routing (for intra-AS routers)
- additional criteria How are BGP messages delivered? What are the 4 types of BGP messages? - CORRECT ANSWERS-BGP messages exchanged between peers over TCP connection
- OPEN: opens TCP connection to remote BGP peer and authenticates sending BGP peer
- UPDATE: advertises new path (or withdraws old)
- KEEPALIVE: keeps connection alive in absence of UPDATES, also ACKs OPEN request
- NOTIFICATION: reports errors in previous msg, also used to close connection Why do we want to separate Intra and Inter-AS routing? - CORRECT ANSWERS- policy: inter-AS admin might want to control how its traffic is routed, and who routes through its network, while policy is less of an issue Intra-AS scale: hierarchical routing saves table size and reduces update traffic performance: intra-AS can focus on performance, while inter-AS dominates policy over performance What is the principle of hot potato routing? - CORRECT ANSWERS-Hot potato routing chooses local gateway that has the least intra-domain cost (link cost), and does not worry about inter-domain cost (AS-PATH) How is policy used in BGP advertising in real life? - CORRECT ANSWERS-- In real life, ISPs would only want to route traffic to or from its customer networks, and does not want to carry transit traffic between two other ISPs. (e.g. ABC connected, B gets no revenue to advertise route BA to C_
- customer networks can be dual-homed (attached to two networks)
- similarly, customer networks do not want to use its network capacity to route between providers. (e.g. BCx connected, x does not advertise xB to C)