DCN Quiz 2

23EAC302 · Dr. Manoj Kumar Panda

Follow the packet.
Understand the network.

Your Quiz 2 study companion. Start with familiar ideas, work through the numbers, then explain each answer without looking.

Based on your syllabus screenshot, slide decks 8–12, and the assigned Forouzan and Kurose & Ross sections.

Build my study route

Download for offline study

YouSwitchRouterHost BLocal hopNext networkIP: where to? · MAC: who’s next?
One journey ties the syllabus together: address → local delivery → forwarding → route selection.

DCN Quiz 2 · Engineering diagrams & worked explanations

Layers inside a network

A layer is a set of jobs inside a device. A protocol is the rule set used to do one of those jobs. Start with the whole stack, then follow one packet.

You do not need five separate machines for five layers. Your laptop runs all five. A normal switch forwards at Layer 2; a normal router forwards at Layer 3.

The same transmission, five responsibilities

Read down the table on the sending host. Read up on the receiving host. The layers cooperate; they are not five competing ways to send a message.

Engineering chart of all five Internet layers, their responsibilities, protocol examples, data-unit names and encapsulation order.
Download image
All five layers are shown. The nested inset is one HTTP-over-TCP-over-IPv4-over-Ethernet example; other combinations are possible. Generated using an image model and checked against the explanations below.

Select a layer to see its job

Use the “Related definitions” links beneath the selected layer to open a plain-language definition.

What talks to what?

Layer

A responsibility group. The network layer handles delivery across networks. It is a conceptual part of a device’s networking software/hardware, not a separate cable box.

Definition: layer

Protocol

Rules between peers. TCP at the sender and TCP at the receiver agree on TCP fields and behavior. HTTP peers agree on requests and responses.

Definition: protocol

Service / interface

What the adjacent layer can use. An application asks transport to send data. Transport asks IP to carry its segment. Each layer uses the one below it.

Definition: service
Logical horizontal relationship; actual vertical handoff.

Use two views at once. Vertically, each layer provides a service to the adjacent layer above it: HTTP hands a message to TCP, TCP hands a segment to IP, IP asks the link layer for one-hop delivery, and the physical layer carries the frame's bits. Horizontally, matching protocols at the two end hosts behave like logical peers—for example, the client and server applications follow HTTP rules—but the real data travels down one host's stack, across the network, and up the other host's stack. Routers normally act on IP and rebuild link frames; switches normally act on MAC-addressed frames; neither needs to read this HTTP request. The packet journey below uses plain, unencrypted HTTP over TCP solely as a teaching example; it does not imply that all web traffic uses this protocol/port combination.

At the receiverWhat identifies the next protocol / recipient?Example
Data link → NetworkEthernet EtherType identifies its payload protocol.0x0800 = IPv4; 0x86DD = IPv6; 0x0806 = ARP.
Network → next protocolIPv4 Protocol (IPv6 Next Header) identifies what follows.6 = TCP; 17 = UDP; 1 = ICMP in IPv4.
Transport → process endpointPort numbers help direct data to the intended socket / application.TCP destination port 80 in this HTTP teaching example.

These fields are identifiers at different boundaries. An IP address is not a port number; a TCP port is not a switch’s physical connector.

Where do ARP, ICMP, DNS and DHCP fit?

ARP: resolves a local next-hop IPv4 address to a MAC address. It crosses the network/link boundary and travels directly in a link frame, not inside TCP/UDP or an IPv4 datagram. ICMP: a network-layer control/error protocol carried inside IP. DNS and DHCP: application-layer protocols, even though their work helps configure or locate network-layer addresses. DNS can use UDP or TCP; DHCP uses UDP in the classroom exchange.

Do not force every protocol onto one vertical pipeline. HTTP→TCP→IP→Ethernet is one flow. ARP is a separate local exchange needed before the data frame can be sent when the MAC mapping is unknown.

HTTPS adds TLS for the common HTTP/1.1 or HTTP/2 over TCP case. HTTP/3 uses QUIC over UDP; “all web traffic uses TCP” is too broad. You can focus on the explicit HTTP-over-TCP example here to understand layering.

Watch the headers get added and removed

The payload is relative to the layer you are looking at: a complete TCP segment is the payload of an IP datagram. The link frame then carries that complete IP datagram.

This is a conceptual containment diagram. It is not a byte-accurate header layout. The physical layer encodes bits as signals; it does not add another “physical header” around the frame.

Which layers does each device use?

Both end hosts use all five layers. Ordinary forwarding inside a switch uses the bottom two; ordinary IP forwarding inside a router uses the bottom three.

Engineering network diagram showing a complete five-layer stack at client and server, two-layer switches, and a three-layer router.
Download image
Dashed peer lines describe logical protocol relationships. The physical transmission still passes through every link. Routers process IP headers, including TTL, and build an outgoing link frame.

Trace one request across two LANs

Client 10.0.1.10:51514 sends to server 10.0.2.20:80. Router interfaces are 10.0.1.1 and 10.0.2.1. We use two switched Ethernet LANs, plain HTTP over TCP, no NAT, and symbolic MAC names A, R1, R2, B.

On a phone, swipe across this engineering diagram. The step controls below explain it in reading order.

HTTP: logical peersTCP: end-to-endClient10.0.1.105 Application4 Transport3 Network2 Data link1 PhysicalSwitch 1Source LAN▪ ▪ ▪ ▪2 Data link1 PhysicalRouterR1: .1.1 / R2: .2.1⇄3 Network2 Data link1 PhysicalSwitch 2Destination LAN▪ ▪ ▪ ▪2 Data link1 PhysicalServer10.0.2.205 Application4 Transport3 Network2 Data link1 PhysicalLAN 1 frame: MAC A → R1LAN 2 frame: MAC R2 → BIP source 10.0.1.10 → IP destination 10.0.2.20 throughout this no-NAT example

Destination IP

Stays 10.0.2.20 through the normal routed path. The router is the next hop, not the final destination. Other IP fields, including TTL and IPv4 header checksum, change.

Destination MAC

First LAN: R1, the gateway’s local interface. Second LAN: B, the server’s NIC. The router replaces the frame; the switches do not rewrite its MAC pair.

Destination TCP port

Stays 80 for this request. It identifies the server endpoint used in the example. Normal IP forwarding does not need to deliver the segment to a web application in the router.

Repeater, hub, switch, router: what decision can it make?

DeviceUses layersOrdinary actionCannot infer from its normal role
Repeater / hubPhysical (1)Regenerates/retimes signals; a hub repeats them to other ports.Which destination MAC or IP should receive the data.
Layer-2 switchData link + Physical (2,1)Learns source MAC → incoming port; looks up destination MAC to forward or filter.An end-to-end IP route from its Layer-2 forwarding table.
RouterNetwork + Data link + Physical (3,2,1)Reads destination IP, selects next hop/output, updates TTL, creates outgoing frame.The application’s message meaning from basic IP forwarding alone.
End hostAll fiveCreates or consumes application messages using the whole stack.That every packet it sees is meant for its application.

Why do some diagrams show seven layers?

They are using the OSI reference model, a different way to group responsibilities. The five-layer Internet teaching model separates physical from data link. Four-layer TCP/IP diagrams combine those bottom two as “link” or “network access.” These are different maps of related jobs, not a demand for seven separate machines.

OSI layerResponsibilityFive-layer Internet grouping
7 ApplicationNetwork services and application protocols used by programs.Application
6 PresentationData representation, encoding, or transformations when required.No separate layer; these functions are generally handled by application protocols or libraries.
5 SessionDialog/session coordination when required.No separate layer; these functions are generally handled by application protocols or libraries.
4 TransportProcess-to-process delivery and transport services.Transport
3 NetworkHost-to-host packet delivery across networks.Network (Internet layer)
2 Data LinkFrame delivery over one link.Link
1 PhysicalSignals carrying bits over a medium.Physical

In the Internet model, application protocols/libraries handle the functions associated with OSI application, presentation and session. For example, encoding, security and conversation management may be handled by application code or supporting libraries. This mapping is conceptual; calling TLS “always exactly OSI layer 6” is an oversimplification.

Understanding checks: explain the reason

Look away from the diagram and give a two-sentence answer before revealing the explanation. Include what the device or protocol knows, and why that information is enough.

When the browser and web server exchange an HTTP message, does it travel directly between the application layers?

That is a logical peer-to-peer relationship: each application follows HTTP's message rules. In the actual transmission, the request passes down the client stack, crosses links and routers, then moves up the server stack.

Why: Keeping logical peer communication separate from actual adjacent-layer delivery explains why a router forwards an IP datagram rather than handing an HTTP message to a browser process.

What does one layer receive from the layer below it?

It receives the service of the adjacent lower layer. For example, IP asks the link layer to carry its datagram to the next node on the current link.

Why: Layering works because each layer uses a lower layer's service and provides a more useful service to the layer above.

What is the difference between port 80 and IP address 10.0.2.20?

10.0.2.20 identifies the destination host/interface at the network layer. TCP destination port 80 identifies the server-side transport endpoint on that host.

Why: A packet needs both a network destination and a destination application endpoint; one number cannot replace the other.

Why does the MAC pair change at a router while the IP pair stays fixed in this example?

The Ethernet frame delivers the IP datagram over one local link. The router removes that frame and builds a new frame for the next link, using the next-hop MAC addresses. Without NAT, the datagram's source and destination IP addresses remain 10.0.1.10 and 10.0.2.20; TTL is decremented.

Why: IP describes the end-to-end endpoints, while MAC addresses deliver a frame across a single link.

The server is outside 10.0.1.10's local subnet. Which IP address does the client resolve with ARP before its first frame?

It resolves its default gateway, 10.0.1.1, to a MAC address on the source LAN. The IP destination in the datagram remains the server, 10.0.2.20.

Why: A host sends an off-subnet IP datagram to its next hop; ARP resolves the local next hop, not a remote server's MAC address.

Is ARP a TCP header or the payload of this HTTP request?

No. ARP is a separate protocol used to resolve an IPv4 address to a link-layer address on the local network. It is not nested inside the TCP segment carrying HTTP.

Why: The host may need ARP before it can form an Ethernet frame, but that support exchange is distinct from application data encapsulation.

Which addresses does a normal Ethernet switch use to forward a frame?

It learns from the source MAC address and looks up the destination MAC address to choose an output port.

Why: A link-layer switch works with frames and MAC addresses; it does not normally choose a route by inspecting the IP destination.

Does the LAN switch rewrite A's source MAC or the gateway's destination MAC?

No. In this example it forwards the frame with source A and destination R1 unchanged.

Why: A switch moves a frame within the LAN. The router terminates that frame and originates a different frame for the next link.

Which layer does the router use for its normal next-hop forwarding decision in this example?

The network layer: it examines the destination IP address. It also receives the incoming link frame and creates an outgoing link frame, but ordinary forwarding does not require it to process the TCP port or HTTP contents.

Why: A router connects IP networks. This distinguishes its layer-3 forwarding role from a switch's layer-2 frame forwarding.

What is inside the Ethernet frame on the first LAN?

Its payload is the IP datagram. The datagram contains the TCP segment, and the segment carries the HTTP message.

Why: Encapsulation nests higher-layer data inside lower-layer protocol units as the sender moves down the stack.

What changes to the IP datagram at the router even though the source and destination IPs do not?

The router decrements TTL by one before forwarding. The IP addresses stay fixed here because the example has no NAT.

Why: TTL limits packet lifetime and helps prevent endless circulation in a routing loop.

Does this example mean every HTTP request must use TCP port 80?

No. This trace deliberately uses plain, unencrypted HTTP over TCP with destination port 80 to make the layers concrete. Other HTTP versions and deployments can use different transport protocols or ports; HTTPS commonly uses TLS, but TLS is not a universal OSI presentation-layer label.

Why: A teaching example fixes one valid stack without turning it into a rule for every real web connection.

Does every application use TCP, and does DNS always use UDP?

No. Applications choose transport services suited to their needs. TCP and UDP are both Internet transport protocols; DNS can use different transport arrangements depending on the exchange and circumstances.

Why: Avoid memorizing overbroad protocol pairings. The important layer concept is that transport delivers data to application endpoints using ports.

Where do OSI session and presentation functions appear in the five-layer Internet model?

The five-layer Internet model has no separate session or presentation layers. Their functions, when needed, are generally implemented as application-layer functions or libraries. The OSI application layer also maps to the Internet application layer.

Why: OSI has seven named layers; the commonly taught Internet stack has five. Their labels are related, but they are not a one-to-one seven-layer implementation.

How does the four-layer TCP/IP model compare with this five-layer stack?

It keeps application, transport, and internet/network layers, then combines the five-layer model's link and physical layers into a network-access or link layer.

Why: Different models group functions differently; the model should not be confused with a different physical packet journey.

A useful exam answer: name the layer → state its job → identify the header/address it uses → explain what happens at the next boundary.
Open the definitions page

A plan for tonight

Read with a pen. For each worked example, cover the answer and try first.

    Time budgets are suggested, not measured reading times. Take short breaks inside each block. If time gets tight, finish the worked examples and the final self-test.

    How to answer in your professor’s style

    The decks repeatedly ask “why?”, compare concepts, then use tables and numerical examples. Practice this sequence: plain idea → correct term → how it works → one example → the trap. The analogies here follow that pattern; these are original study notes, not the professor’s words.

    Reality check: lecture-only discussions and the exact quiz format are not in this folder. The questions below are practice we created from the supplied material.

    IPv4 addressing: finding the network and the interface

    Why does an IP address need more than a unique number? Routers must forward packets across many networks. IPv4 gives addresses a hierarchy: leading bits identify a network prefix; remaining bits identify a point of connection within it. This chapter explains CIDR blocks, subnet division, and how a host learns its address.

    An IP address belongs to an interface

    An IPv4 address is a 32-bit network-layer address assigned to an interface, where a host or router connects to a network. Calling it “the computer’s address” is shorthand: a router with three network connections normally has three IP addresses. If a laptop moves from campus to home, its network connection changes and it may receive a different address.

    Think of a postal address as identifying a delivery point, not the person who owns the house. A person can move and the delivery address changes; one building can also contain many delivery points. Similarly, an IP address locates a network interface in its current network context. The address must be unique within the relevant Internet addressing scope, and the shared format lets routers interpret it consistently.

    Forouzan §7.4.1, p. 211; Slide deck 8, slides 2–3; Kurose and Ross §4.3, pp. 334–335.

    Three ways to write the same 32 bits

    IPv4 has 232 possible patterns. The value is always 32 bits; notation changes only how it is displayed.

    • Binary: all 32 bits are shown, such as 11000000 10101000 00000001 00001010.
    • Dotted decimal: divide the bits into four 8-bit octets, convert each octet to decimal, and put dots between them. The example becomes 192.168.1.10. Each octet ranges from 0 through 255.
    • Hexadecimal: write each group of four bits as one hex digit. The same value is C0A8010A. Hex is compact and convenient in programming; dotted decimal is easier to scan in network configuration.

    For quick conversion, remember octet bit weights 128, 64, 32, 16, 8, 4, 2, 1. Thus 11000000 is 128 + 64 = 192. Each decimal octet must be between 0 and 255.

    Worked conversion. 14.24.74.0 in binary is 00001110 00011000 01001010 00000000, one 32-bit value rather than four separate addresses.

    Forouzan §7.4.1, pp. 211–212; Slide deck 8, slides 3–4.

    The prefix and suffix create hierarchy

    Suppose a postal address names a country, city, street, then a house. A delivery system can first move mail toward the right city and only later distinguish a street and house. IP addressing uses a related idea. The prefix is the leading network portion. The suffix is the remaining portion used within that network to distinguish addresses. The exact boundary is a design choice and is written explicitly in modern CIDR notation.

    Network prefix: n bitsshared network identity Suffix: 32 − n bitsinterface address space bit 0 (most significant)bit 31 IPv4 address: 32 bits total
    For 192.168.1.10/24, the first 24 bits are the prefix and the last 8 bits are the suffix.

    A longer prefix leaves fewer suffix bits and a smaller block; a shorter prefix leaves more suffix bits and a larger block. The number of patterns is 2^(32 − n), where n is the prefix length, though not every pattern is necessarily an ordinary host address.

    Trap: “Network part” and “host part” are useful teaching labels, but suffix bits identify an address within the block; they do not always correspond to a physical computer. Routers have interface addresses, and special addresses in a conventional subnet are not ordinary host assignments.

    Forouzan §7.4.1, pp. 212–214; Slide deck 8, slides 5–6; Kurose and Ross §4.3, pp. 337–338.

    Classful addressing: the historical fixed boundaries

    Early IPv4 addressing inferred the prefix length from the first bits. This was called classful addressing. Classes A, B, and C provided fixed prefix lengths of 8, 16, and 24 bits. Class D was reserved for multicast, and Class E was reserved. The table gives the bit-pattern counts taught by the lecture and the familiar leading-octet ranges.

    ClassLeading patternLeading-octet rangePrefix in old schemeNetwork-ID / block count noteAddress patterns per block
    A00–127/827 possible class network identifiers (lecture count)224 per /8 block
    B10128–191/16214 possible class network identifiers216 per /16 block
    C110192–223/24221 possible class network identifiers28 per /24 block
    D1110224–239No prefix/suffix split hereMulticast address spaceNot a classful host block
    E1111240–255No prefix/suffix split hereReserved in the lecture’s accountNot a classful host block

    The class marker uses some prefix bits: for Class B, initial 10 leaves 14 network-ID bits in its 16-bit prefix. The slide’s 2^14 is theoretical, not a guarantee every pattern could be assigned.

    Keep three counts separate. The lecture’s 2^7, 2^14, and 2^21 are possible network identifiers after class marker bits; 2^24 counts patterns in one Class A /8. Usable hosts are fewer under conventional subnet rules, and historical assignments may exclude special ranges or identifiers. Do not mistake theoretical counts for actual allocations. Classful sizing became wasteful: a network needing thousands of addresses faced a /24 too small or a /16 too large. CIDR replaced this rigid fit.

    Forouzan §7.4.1, pp. 212–213; Slide deck 8, slides 7–10; Kurose and Ross §4.3, p. 338.

    CIDR and masks: state the boundary directly

    CIDR (Classless Interdomain Routing, pronounced “cider”) writes an address with a slash prefix, as in 192.168.1.10/24. The slash number says exactly how many leading bits belong to the prefix. CIDR blocks must contain a power-of-two number of addresses. For prefix /n, the suffix has 32 − n bits, so the block has 2^(32 − n) address patterns.

    A subnet mask is the same boundary written as 32 bits: prefix bits are all 1 and suffix bits are all 0. For /24, the mask is 11111111.11111111.11111111.00000000, or 255.255.255.0. For /26, it is 11111111.11111111.11111111.11000000, or 255.255.255.192 because 128 + 64 = 192 in the last octet.

    Mask conversion, step by step. Convert /20 to dotted decimal. Fill the first 20 bits with 1s: two complete octets give 255.255; the next four bits are 1 and the next four are 0, so that octet is 11110000 = 240; the last octet is all zero. Thus the mask is 255.255.240.0. Reverse the check: 8 + 8 + 4 = 20 one-bits.

    Prefix length n → mask with n leading 1s → block size N = 232−n. Conversely, a block with N addresses has prefix length n = 32 − log2N.

    Trap: The slash number counts bits, not octets and not the number of hosts. A /26 has 26 prefix bits and 6 suffix bits, so it contains 64 address patterns.

    Forouzan §7.4.1, pp. 213–215; Slide deck 8, slides 11–13; Kurose and Ross §4.3, pp. 337–339.

    Block addresses, usable hosts, and bitwise boundaries

    In the standard subnet calculation, the first address in a block is the network address: set every suffix bit to zero. The last address is the directed broadcast address: set every suffix bit to one. Every address pattern between them is conventionally available for host or router interfaces. For common IPv4 subnets with at least two suffix bits, the familiar usable count is block size − 2. This is the distinction between total addresses and ordinary usable interface addresses.

    Two edge cases need care. A /31 contains two addresses and is commonly used on point-to-point links, where both can be used as interface endpoints under the special /31 convention; do not blindly subtract two there. A /32 contains one address and identifies a single address/route, not a conventional multi-host subnet. Follow the convention stated in a problem if it specifies one; otherwise state the conventional rule and its /31 exception.

    Worked /26 range. Find the block containing 192.168.1.77/26. A /26 has six suffix bits and 2^6 = 64 addresses. The mask is 255.255.255.192. AND the address and mask: in the last octet, 77 is 01001101 and 192 is 11000000; the result is 01000000 = 64. Therefore the network address is 192.168.1.64. Set the six suffix bits to 1: last octet 01111111 = 127, so broadcast is 192.168.1.127. The block is .64–.127 inclusive (64 total); conventional usable range is 192.168.1.65–192.168.1.126 (62 interfaces).

    Distinguish this subnet-directed broadcast from the limited broadcast address 255.255.255.255. A directed broadcast has the subnet prefix plus all-one host bits—for example, 192.168.1.127 is the directed broadcast for 192.168.1.64/26. It targets hosts on that subnet, and routers may forward it subject to policy. The limited broadcast reaches the local link/subnet only and is not forwarded by routers; a newly connected DHCP client uses it before it knows its subnet.

    The bitwise operations provide a general method that works even when a prefix boundary cuts through an octet. For any address in the block, network = address AND mask. The broadcast is address OR (NOT mask). Here, NOT the /26 mask leaves six 1s at the right; OR replaces the suffix with 1s. To find the total count, either compute 2^(32−n) or invert the mask and add 1.

    Worked /20 range. Find the block containing 18.14.27.9/20. The /20 mask is 255.255.240.0, leaving 12 suffix bits and 2^12 = 4096 addresses. The third octet is grouped in increments of 16 because the mask’s third octet is 240. The value 27 lies in the 16–31 block. AND gives network 18.14.16.0; set the last 12 bits to one to get broadcast 18.14.31.255. Total count is 4096 and conventional usable count is 4094, with usable range 18.14.16.1–18.14.31.254.

    Forouzan §7.4.1, pp. 214–216; Slide deck 8, slides 12–15; Kurose and Ross §4.3, pp. 338–339.

    Subnetting: give each island a correctly sized block

    Subnetting divides an allocated address range into smaller ranges, one per subnetwork. The reliable procedure is: (1) sort requirements from largest to smallest; (2) round each requested number of addresses up to the next power of two; (3) convert that block size to a prefix; (4) place each block at a correctly aligned boundary without overlap; and (5) account for the unused remainder. Allocate largest first because small blocks can fit into the leftover gaps, while placing a large block after several small ones can fragment the space.

    14.24.74.0/24 — 256 total address patterns 128 · /25need 120 64 · /26need 60 16/28 48reserve .0.127.191.207.255 Boundaries are aligned to each block size; address ranges do not overlap.
    Block widths are proportional to address counts; the reserve is not one new subnet unless later divided with valid alignment.

    Professor’s VLSM allocation. Divide 14.24.74.0/24 for needs of 120, 60, and 10 addresses. The parent /24 has 256 patterns. Start with 120: round up to 128 = 27, giving /25 because 32 − 7 = 25. Allocate 14.24.74.0–14.24.74.127 (/25). Next, 60 rounds up to 64 = 26, hence /26. The next aligned 64-address boundary is .128, so allocate 14.24.74.128–14.24.74.191. Finally, 10 rounds up to 16 = 24, hence /28; the next aligned boundary is .192, giving 14.24.74.192–14.24.74.207. Sum: 128 + 64 + 16 = 208 allocated address patterns. The remaining reserve is 14.24.74.208–14.24.74.255, 48 patterns. Under conventional network/broadcast reservations, those three subnets provide 126, 62, and 14 interface addresses respectively; this comfortably meets the requested 120, 60, and 10.

    Slide deck 8, slides 16–19; Forouzan §7.4.1, pp. 216–217.

    Alignment and aggregation: matching prefixes matters

    A block of N addresses must start at a numeric address divisible by N. A /22 has 2^(32−22) = 1024 addresses. The lecture’s 18.14.12.0/22 satisfies alignment: its integer value is 302,910,464, or 295,811×1024. Its range is 18.14.12.0–18.14.15.255. In the third octet, /22 blocks advance by 4, and 12 is aligned.

    Address aggregation combines adjacent blocks under a shorter common prefix, letting a router advertise one summary instead of many individual routes. For example, four contiguous /24 blocks 192.0.2.0/24 through 192.0.5.0/24 cannot be summarized as one /22: they are not a four-block aligned group. Two adjacent blocks 192.0.2.0/24 and 192.0.3.0/24 do combine cleanly into 192.0.2.0/23, because the pair is contiguous and the first block is aligned to 512 addresses. The /23 covers exactly those two /24s.

    For an aggregation to be exact, the component blocks must be contiguous, equal-sized sibling ranges, and begin on the larger block’s boundary. Two adjacent /24 blocks starting at 192.0.2.0 and 192.0.3.0 satisfy the /23 boundary; 192.0.3.0/24 plus 192.0.4.0/24 does not, because the first is not aligned to a /23 boundary. A summary that includes addresses outside the intended set may be a broader route in some routing designs, but it is not an exact aggregation of just those component blocks. CIDR allocation is valuable partly because well-aligned related allocations can be summarized in routing tables.

    Alignment trap: “There are enough free addresses after this point” is not sufficient. The starting address must be divisible by the block size. For /26 blocks, last-octet boundaries are 0, 64, 128, and 192. Starting a 64-address block at .96 would overlap boundaries and cannot describe a single /26.

    Slide deck 8, slides 15–20; Forouzan §7.4.1, pp. 216–218; Kurose and Ross §4.3, pp. 339–340.

    Find subnets as islands of connected interfaces

    A subnet is not necessarily “one building” or “one router.” Kurose and Ross give a practical diagram method: detach every host and router interface from its device, leaving each network segment as an island with interfaces at its endpoints. Each island is a subnet. An Ethernet LAN connecting several host interfaces and one router interface is one subnet. A point-to-point router link is also a subnet, even though it has no group of end hosts. A router connecting three LANs has interfaces in three different subnets, plus more subnet interfaces if it has point-to-point links.

    Every interface in an island must share its subnet prefix. For example, 223.1.1.1, 223.1.1.2, and router interface 223.1.1.4 can belong to 223.1.1.0/24; the router’s interface on 223.1.2.0/24 belongs to another island.

    Kurose and Ross §4.3, pp. 334–337; Slide deck 8, slides 5 and 20.

    DHCP: how a new host gets an address (DORA)

    A newly connected host may not know its own address, the subnet mask, the default gateway, or the local DNS server. The Dynamic Host Configuration Protocol (DHCP) lets it request this configuration from a server. A server can assign a stable address to a host or lease a temporary one for a limited time. A DHCP relay agent, often a router, can pass requests to a server on another subnet.

    Remember the four-message sequence with DORA: Discover, Offer, Request, Acknowledge. At the start, the client does not know the DHCP server address, so it uses source IP 0.0.0.0 and broadcast destination 255.255.255.255. DHCP uses UDP ports 68 (client) and 67 (server) in the described exchange.

    1. Discover: the client broadcasts “is there a DHCP server?” It has no configured address yet.
    2. Offer: one or more servers reply with an offered address plus configuration and a lease duration. The offer is broadcast so the unconfigured client can receive it.
    3. Request: the client broadcasts its choice, naming the requested address and selected server. Broadcasting also informs other offering servers that their offers were not selected.
    4. Acknowledge: the selected server confirms the lease and configuration. The client can then configure its interface.

    Sequence trap: The first packet cannot be a normal unicast request to the server because the client does not yet know where the server is. Keep Discover and Request distinct: Discover locates possible servers; Request tells the servers which offer the client selected.

    Mobility limitation (Slide 11 overview): when a node joins a new subnet, DHCP normally gives it a new IP address. An ongoing TCP connection to a remote application may then be disrupted because its endpoint address has changed. Mobile IP is intended to let a moving node retain one permanent address across subnet changes. This is only the lecture’s overview; detailed Mobile IP mechanisms in Forouzan §7.4.5 are outside this chapter.

    Kurose and Ross §4.3, pp. 341–344; Slide deck 8 references Kurose §4.3.

    Exam method: write the boundary before the answer

    For address problems, write the prefix and mask, count suffix bits, calculate block size, and find the aligned network address. Verify the endpoints; distinguish total patterns from usable interfaces. For subnetting, allocate largest-first, show each size, prefix, and range, then account for reserve. Check contiguity and alignment for aggregation. For topology, count network islands; for DHCP, write DORA.

    Common mistakes: applying class boundaries to CIDR, rounding subnet needs down, accepting an unaligned start, forgetting reserve, and assigning one address to a router.

    Forouzan §7.4.1; Slide deck 8; Kurose and Ross §4.3.

    Quick checks

    Does one IPv4 address identify a whole router?
    No. It is assigned to an interface. A router with multiple network connections normally has an address on each connected subnet.
    How many total patterns and conventional usable addresses are in a /26?
    There are 32 − 26 = 6 suffix bits, so 2⁶ = 64 total patterns. Under conventional subnet rules, network and broadcast are reserved, leaving 62 usable interface addresses.
    What dotted-decimal mask corresponds to /20?
    255.255.240.0. The mask has 8 + 8 + 4 = 20 leading one-bits.
    What is the network address for 192.168.1.77/26?
    192.168.1.64. A /26 has 64-address increments in the last octet; 77 lies in the .64–.127 block. ANDing with 255.255.255.192 gives .64.
    Why does a 120-address request need a 128-pattern block?
    CIDR blocks have power-of-two sizes. The next power of two at least 120 is 128, which gives seven suffix bits and prefix /25.
    After the three VLSM allocations, what remains in 14.24.74.0/24?
    The blocks consume 128 + 64 + 16 = 208 patterns. The remaining 48 are 14.24.74.208–14.24.74.255. That 48-pattern remainder is not one power-of-two block.
    Can 192.0.2.0/24 and 192.0.3.0/24 be exactly summarized as one /23?
    Yes. They are adjacent, equal-sized /24 blocks, and the first address is aligned to the 512-address /23 boundary. The combined range is exactly 192.0.2.0–192.0.3.255.
    What is the correct order for DHCP DORA?
    Discover, Offer, Request, Acknowledge. The client initially broadcasts because it does not yet know its own configured address or the server address.

    Connecting devices, MAC addresses, and ARP

    Why do a LAN and an internetwork need different kinds of connecting devices? A bit signal must first travel across a medium, a local frame must reach the right interface, and a packet may need to cross several networks. A tap, repeater or hub, link-layer switch, and router help at different layers. This section follows a message through those layers and shows how switches learn where interfaces are and how ARP finds a next-hop MAC address.

    1. Connecting devices act at different layers

    A connecting device joins hosts into a network or joins networks into an internetwork. Its layer tells us what information it can use: signals and bits, frames and MAC addresses, or IP packets and routes between networks.

    DeviceWhere it actsWhat it doesDoes it inspect destination MAC/IP?
    TapPhysical mediumMakes a connection into a cable, such as a bus cable; cable lengths and termination help limit reflections.No frame-address decision.
    RepeaterPhysical layer (Layer 1)Regenerates and retimes a bit pattern and sends a refreshed signal onward.No.
    HubPhysical layer (Layer 1), multiport repeaterRegenerates an incoming signal and repeats it out the other ports.No; it cannot filter for a particular station.
    Link-layer switchPhysical and data-link layers (Layers 1–2)Regenerates signals and uses a MAC switching table to filter or forward frames.Yes, MAC addresses; it does not route by IP.
    RouterPhysical, data-link, and network layers (Layers 1–3)Receives a frame addressed to one of its interfaces, examines the IP destination, and forwards the packet toward another network in a new frame.Yes, MAC and IP addresses.

    Think of a repeater as a person who hears a weak message and repeats it clearly to extend how far the signal can travel. A hub is that helper connected to several rooms: the message is repeated into every other room. The hub does not understand the addressee. A switch is like a building’s mailroom with a directory of room numbers. A router is more like a post office that reads the destination area and sends the parcel toward another town.

    A tap splices into a cable or contacts its metallic core; it is a physical-medium connection, not a frame-processing device. A repeater addresses attenuation and corruption by regenerating and retiming the bit pattern before it becomes unreadable. It does not merely increase signal amplitude, which would also amplify noise; it reconstructs and emits a refreshed bit pattern.

    A hub is a multiport repeater commonly associated with star wiring. It repeats a signal through all ports except the one it arrived on. Every attached station sees the frame; the destination accepts it and the others discard it. The hub does not know which station is intended, and hubs and repeaters have no MAC address for filtering.

    A link-layer switch also regenerates the signal, but reads source and destination MAC fields. It leaves those addresses unchanged within the LAN. Its MAC switching table maps an address to the port where it was observed. A router adds the network-layer decision: each interface has link-layer and network-layer addresses, and forwarding to the next link requires a new frame.

    More information available at each device Physical mediumTap Layer 1Repeater / hub Layers 1–2Link-layer switch Layers 1–3Router NetworkData linkPhysicalMedium bits / signalsMAC frameIP packet + frame
    Figure 1. Each step up the stack allows a device to interpret more of the transmission. The tap connects at the medium; it does not interpret a protocol layer.

    Forouzan, Data Communication and Networking, §§6.1, 6.1.1–6.1.3; Slide deck 10, “Connecting Devices.”

    2. Switch learning: source to learn, destination to forward

    Remember this division of work: the source MAC address teaches the switch where the sender is; the destination MAC address is looked up to decide where to forward. A switch does not learn the destination address from the frame as a destination. It learns from the source. It can update an existing source entry if that MAC now arrives on a different port.

    If the destination is known on another port, the switch sends the frame only there. If it is known on the arrival port, the switch filters it instead of sending it back. If unknown, it floods all ports except the arrival port. Broadcast frames also go to other ports in the same LAN/VLAN.

    Worked trace. Consider one switch with port 1 = A, port 2 = B, port 3 = C, and port 4 = D. The table starts empty. Use short labels A–D for each station’s unique MAC address.

    #Frame (source → destination)Table before lookupForwarding actionTable after source learning
    1A → DEmptyD unknown: flood to ports 2, 3, 4. Port 1 is excluded.A → 1
    2D → BA → 1B unknown: flood to ports 1, 2, 3. Port 4 excluded.A → 1; D → 4
    3B → AA → 1; D → 4A is known at port 1: send only to port 1.A → 1; D → 4; B → 2
    4A → DA → 1; D → 4; B → 2D is known at port 4: send only to port 4.Same entries
    5A → BA → 1; D → 4; B → 2B is known on arrival port 1. Filter: send nowhere.Same entries
    6C → DA → 1; D → 4; B → 2D is known at port 4: send only to port 4.A → 1; D → 4; B → 2; C → 3

    Check rows 1 and 2: destination lookup happens while the destination may still be unknown, but source learning happens from that very frame. By row 4 the switch has learned D’s port from D’s earlier source frame. In row 5 the switch does know B’s port, but it is the same port as the sender; forwarding back onto that port is unnecessary, so filtering is correct.

    This behavior is the basis of a transparent switch: end stations need no reconfiguration when it is inserted or removed. The system must forward correctly, learn the forwarding table from frame movement, and prevent loops. If a station moves and sends from another port, the switch can update its source-MAC entry. A quiet station that has never transmitted may have no entry yet.

    Redundant switch links improve resilience, but a physical loop can make flooded frames circulate and multiply. MAC learning alone does not make a loop safe. A spanning tree logically disables selected paths so the active topology has no loop and only one path through the tree. If a path fails, the process can re-form the usable topology.

    Collision and broadcast domains are related but different. A hub repeats signals across its ports, so attached devices share the medium and, in classic half-duplex Ethernet, one collision domain. A switch usually gives each port its own link and collision domain; on modern full-duplex switched Ethernet, the link has no Ethernet collisions. This qualification matters: a switch connected to a hub shares that hub segment’s collision domain on that port. A switch does not, by itself, stop Layer 2 broadcasts: a broadcast is flooded within its LAN or VLAN. A router normally does not forward that link-layer broadcast onto another network, so a router interface marks a broadcast-domain boundary. VLAN configuration can create separate broadcast domains on switching equipment; “one switch equals one broadcast domain” is therefore too broad.

    Common trap: say “unknown destination floods,” but do not say “the switch learns the destination port from that destination field.” The switch learns the source-to-arrival-port mapping. Also distinguish flooding a frame within the local LAN/VLAN from a router forwarding an IP packet to another network.

    Forouzan, §6.1.2, “Link-Layer Switches,” “Transparent Switches,” and “Loop Problem”; Slide deck 10, “Link-layer Switches” and “Transparent Link-layer Switches.”

    3. MAC addresses: local delivery labels

    A link-layer address, Layer 2 address, LAN address, physical address, or MAC address names a network interface on a link. For common Ethernet and Wi-Fi LANs, it is 48 bits (six bytes), usually written as six pairs of hexadecimal digits, such as 02:34:45:11:92:F1. A frame has a destination MAC and a source MAC. Ethernet’s all-ones broadcast destination is FF:FF:FF:FF:FF:FF.

    There are unicast, broadcast, and multicast destination types. Unicast is one-to-one; broadcast is one-to-all interfaces on the link; multicast is one-to-a-selected group. In a standard MAC address, the least significant bit of the first octet is the I/G (individual/group) bit: 0 marks an individual address and 1 a group address. Thus A2 has I/G=0, while A3 has I/G=1. The lecture slide labels A3:34:45:11:92:F1 unicast, but that is an error: A3 is a group address. A unicast example is A2:34:45:11:92:F1. The all-ones broadcast is also a group destination.

    An IP address is like a postal address: its network prefix gives location and its host portion identifies a destination in that location. When a device moves to another network, its IP configuration may change. A MAC address is more like an Aadhaar or PAN number in the lecture analogy: it is a flat identifier associated with an interface rather than a hierarchical location. The analogy helps separate “who/which interface” from “where”; it is not a claim that a MAC address is a personal identity.

    In the simplified model used for learning, assume an adapter keeps a fixed MAC address while IP addressing changes with network attachment. Real systems can use locally administered addresses, privacy randomization, or software overrides, and replacing a network adapter can also change its MAC address. The fixed-MAC assumption is a useful classroom simplification, not a guarantee that an observed address can never change. Keeping IP and MAC addressing separate also means a change in the network-layer protocol does not require rebuilding every network adapter’s hardware address.

    Why have both? Network-layer IP addresses identify packet endpoints and support routing across networks. Link-layer addresses deliver a frame over one local link. A packet’s source and destination IP addresses generally remain the same across its route; each new link gets a new frame with the local sender and next-hop MAC addresses. Thus the MAC pair can change at every routed hop, while the IP pair is carried end-to-end (ignoring special functions such as address translation, which are outside this model).

    Forouzan, §3.4, “Link-Layer Addressing”; Slide deck 9, “Link Layer Addressing” and “IP Addresses Vs. MAC Addresses.”

    4. ARP: resolve a next hop on the local subnet

    ARP, the Address Resolution Protocol, maps a known IPv4 address to a link-layer address on the same subnet (local LAN). It does not route between networks. A host first decides whether the destination IP is local. If remote, it needs the MAC of its next hop, normally the local router interface; the IP destination remains the remote host.

    If A lacks B’s IP-to-MAC entry on the same subnet, A broadcasts an ARP request on the local link. It carries A’s hardware/MAC and protocol/IP addresses and B’s protocol/IP address; the target hardware address is unknown. On Ethernet the destination is FF:FF:FF:FF:FF:FF. B recognizes its IP and usually replies by unicast with its IP-to-MAC mapping. A caches the answer; B may learn A’s mapping from the request. A switch may learn A’s source MAC-to-port from the Ethernet frame carrying the request.

    ARP cache entries reduce repeated requests and expire; the lecture gives about 20 minutes as an example. An entry might be 192.0.2.20 → 02:34:45:11:92:F1. The hardware address is the link-layer MAC; the protocol address is IPv4. ARP fields specify hardware/protocol types and lengths, operation (request or reply), and sender/target addresses.

    Worked delivery: A and B are on different subnets. Let A be 192.0.2.10, MAC 02:00:00:00:00:0A, with gateway G1 at 192.0.2.1, MAC 02:00:00:00:01:01. Let remote B be 198.51.100.20, MAC 02:00:00:00:02:20, on a network reached through router interface G2, MAC 02:00:00:00:02:01. Assume the route is directly between these two router interfaces.

    Step / linkFrame source MAC → destination MACIP packet source → destinationWhat the node does
    1. A resolves gateway, if neededA → broadcastARP request asks for G1’s local IP-to-MAC mapping (ARP is not the data packet).Only the local link receives this ARP broadcast; G1 answers, usually by unicast to A.
    2. A sends on subnet 1A → G1192.0.2.10 → 198.51.100.20A knows B is remote, so it sends the packet to its next hop G1 in a frame.
    3. Router sends on subnet 2G2 → B192.0.2.10 → 198.51.100.20Router removes the old frame, routes the IP packet, resolves B’s MAC on that directly connected subnet if needed, and puts the packet in a new frame.

    The packet’s IP endpoints remain A and B, but the frame endpoints on step 2 are A and G1; on step 3 they are G2 and B. If there are more routers, each hop repeats the link-layer replacement. ARP resolves the next hop on each local subnet when needed; it does not ask A to discover B’s MAC across the internetwork.

    Subnet 1Subnet 2 Host AIP .10 Router G1MAC .01 Router G2MAC .02 Host BIP .20 routing between networks Frame: A MAC → G1 MACFrame: G2 MAC → B MAC IP packet throughout: source A IP → destination B IP
    Figure 2. Routers forward an IP packet between networks and build a new link-layer frame for each outgoing link.

    Common trap: for remote B, A does not ARP for B’s far-away MAC. A ARPs for its local gateway’s MAC, sends the IP packet addressed to B inside that frame, and lets the router continue delivery.

    Forouzan, §§3.4 and 7.4.2; Slide deck 9, “Address Resolution Protocol” and “ARP Table.”

    5. Quick checks

    1. A weak signal is refreshed and retimed, but its frame addresses are never examined. Which device function is this?

    A repeater function at the physical layer. It reconstructs the bit pattern and forwards the refreshed signal; amplification alone would not repair a corrupted bit pattern.

    2. A switch receives a frame from port 3 with source C and unknown destination Z. Which address does it learn, and where does it flood?

    It learns C → port 3 from the source address. Since Z is unknown, it floods the frame to all other eligible ports, excluding port 3.

    3. A known destination is mapped to the same port where the frame arrived. Why does the switch filter it?

    The destination is reachable on the incoming port’s LAN segment. Sending the frame back out that same port cannot help reach a different segment, so the switch suppresses it.

    4. Does adding a Layer 2 switch automatically create separate broadcast domains for every port?

    No. A switch ordinarily forwards a LAN/VLAN broadcast to its other ports in that broadcast domain. Routers separate broadcast domains; VLAN configuration can also define separate Layer 2 broadcast domains.

    5. In the MAC example A3:34:45:11:92:F1, what does the I/G bit say?

    The least significant bit in first octet A3 is 1, so it is a group address, not a unicast individual address. The lecture’s unicast label on this example is mistaken.

    6. A host sends to a destination IP on another subnet. Which MAC address does it need first?

    The local next-hop router interface MAC, usually the default gateway. It places the remote destination IP in the packet, then uses a local frame addressed to the gateway.

    7. Between A and B across one router, which addresses stay constant and which change?

    In this simplified path, the IP source/destination stay A IP → B IP. The MAC pair changes from A → router incoming interface on the first link to router outgoing interface → B on the next link.

    8. What is ARP’s job, and is an ARP request normally sent as unicast?

    ARP maps an IPv4 address to a MAC address on the local subnet. A sender who lacks the mapping broadcasts the request on that link; the intended node usually replies by unicast.

    Network layer: moving packets across networks

    The network layer gives transport protocols a way to send a packet from one host to another even when many routers and different link technologies lie between them. It has two related jobs: choose paths across the network, and move each arriving packet to the correct outgoing link. The first is a network-wide decision; the second happens locally at every router.

    Two jobs: routing and forwarding

    Imagine sending a registered letter. Routing is the planning that selects a sequence of towns and post offices. Forwarding is the local clerk reading the destination and placing this particular letter in the outgoing sack for the next stop. The analogy separates two jobs, but packet forwarding uses header fields and a table rather than a postal worker remembering a route.

    Forwarding is the per-router data-plane action that maps an arriving datagram to an output interface. A router consults its forwarding table for each packet. Routing is the control-plane process that determines paths through multiple routers and supplies the local forwarding information. The forwarding table is the interface between these jobs: control logic computes or installs entries; the data plane applies them quickly.

    In traditional per-router control, each router runs routing logic, exchanges routing information with other routers, and calculates its own forwarding table. With software-defined networking (SDN), forwarding remains in the routers, while a logically centralized controller computes and distributes rules. “Logically centralized” describes one coordinated network-wide view; the controller can be physically distributed for reliability. This distinction does not change the basic packet-forwarding task at an individual router.

    Routing / control planechooses paths; installs entries forwarding table Router data planematches each packet output linknext hop Per-router controlSDN controllerEither way, the local forwarding decision is per packet.
    Control logic decides what forwarding entries should say; the data plane uses those entries for individual datagrams.

    Kurose and Ross §4.1; Lecture 11, Network Layer: Data Plane; Lecture 12, Control Plane.

    What service does IP promise?

    The Internet Protocol offers a best-effort datagram service. “Best effort” means IP tries to deliver a packet, but does not promise delivery, a maximum delay, in-order arrival, bandwidth, or protection against duplicate delivery. A packet can be lost, delayed, corrupted, or arrive out of order. IP is connectionless: routers treat each datagram independently rather than establishing a network-layer connection with reserved state before sending.

    A network service model could, in principle, promise guaranteed delivery, delivery within a delay bound, in-order delivery, a minimum bandwidth, or security such as encryption. These possibilities describe what the network layer might offer to transport; they are not all promises made by IP. The Internet’s basic IP service is best effort: it provides none of those guarantees. Applications that need reliability commonly rely on a higher layer, such as TCP; real-time applications may prefer to tolerate some loss rather than wait for retransmission. A common exam trap is to say “IP guarantees delivery because it routes packets.” Path selection and reliable delivery are different problems.

    Kurose and Ross §4.1; Forouzan §7.4 (IPv4 service and datagram approach).

    IPv4 datagram header: fields that guide delivery

    An IPv4 datagram has a header followed by payload. The header is at least 20 bytes; the IHL field expresses its length in 4-byte words. Thus IHL = 5 means 20 bytes, not 5 bytes. The total-length field counts the complete datagram, header plus payload. A router reads fields such as the destination address to make its forwarding decision, while other fields support delivery, lifetime limits, and fragmentation.

    FieldMeaning and useQuick check
    Version4 bits; value 4 identifies this as IPv4.First nibble of 0x45 is 4.
    IHL (header length)4 bits; header length in 4-byte words; minimum is 5, so 20 bytes.IHL 6 = 24-byte header.
    Service / DS field8 bits; marks traffic treatment, including congestion notification.Not a delivery guarantee.
    Total lengthLength of header plus payload in bytes.1500 means 1500 bytes total.
    Identification16-bit label shared by fragments from one datagram.Reassembly context uses source, destination, protocol, and identification; offset locates each piece.
    FlagsIncludes the “more fragments” indication (MF); MF=1 means more pieces follow.Final fragment has MF=0.
    Fragment offsetPosition of this fragment’s payload in the original payload, measured in 8-byte units.Offset 185 means byte position 1480.
    TTL (time to live)Reduced by each router; a packet whose TTL reaches zero is discarded.Helps prevent endless loops.
    ProtocolIdentifies the payload’s next protocol, such as TCP (6) or UDP (17).Not the TCP/UDP port number.
    Header checksum16-bit check of the IPv4 header; updated as fields such as TTL change.It is not a checksum of the payload.
    Source address32-bit IPv4 address of the sender; used for replies and packet identification.One address, not a TCP/UDP port.
    Destination address32-bit IPv4 address of the intended receiver; routers use it to forward.Longest-prefix lookup uses this field.

    Keep the three “where does it go?” layers distinct: the IP protocol field identifies which next protocol gets the payload at the destination (often a transport protocol); a TCP/UDP port identifies an application endpoint; and an IP destination address guides network-layer delivery. The IPv4 header also includes fields such as version and service/traffic markings, but the table above emphasizes the fields needed for this lesson’s calculations.

    Forouzan §7.4, “Datagram Format” (field descriptions); Lecture 11, IPv4 Datagram Format.

    Header numbers you should know

    Read the IPv4 header as a labeled form on a parcel. Version: 4 bits (value 4 for IPv4); IHL: 4 bits; service/DS field: 8 bits (traffic treatment, including congestion notification); total length: 16 bits; identification: 16 bits; flags: 3 bits; fragment offset: 13 bits; TTL: 8 bits; protocol: 8 bits; header checksum: 16 bits; source and destination: 32 bits each. Options and padding can extend the header, but the syllabus excludes the detailed options section.

    IHL ranges from 5 to 15, meaning 20–60 bytes. The total-length field allows at most 65,535 bytes including the header. Payload length = total length − 4×IHL. The flags are a reserved bit, DF (Don’t Fragment) and MF (More Fragments). If DF=1 and a datagram exceeds the outgoing MTU, the router cannot fragment it and must discard it. MF=0 can indicate a final fragment or an unfragmented packet; use the offset as well.

    Read the bytes like the textbook. The first byte is hexadecimal 45: its high nibble is version 4 and its low nibble is IHL 5, giving a 20-byte header. A first byte of 42 would claim an eight-byte IPv4 header, below the minimum, so it is invalid. For total length 100 and IHL 5, payload = 100−20 = 80 bytes. If fragment offset=100, its first original-payload byte is 100×8 = 800; the last is 800+80−1 = 879 (zero-based numbering).

    Header checksum: add, wrap, invert

    The IPv4 checksum checks only the header. Split its bytes into 16-bit words, temporarily set the checksum word to zero, add all words using one’s-complement addition (wrap any carry back into the low 16 bits), and invert all 16 bits. A receiver adds the header including the checksum: a valid result is all ones, FFFF in hexadecimal. This detects many errors; it does not correct them or guarantee reliable delivery.

    Worked checksum: how do the carries wrap?

    For this original example header, the 16-bit hexadecimal words with checksum zero are 4500 001C 0001 0000 4011 0000 C000 0201 C633 6402. All values in this calculation are hexadecimal. Their ordinary sum is 0x27164. Wrap the carry: 0x7164 + 0x0002 = 0x7166. Invert 16 bits: 0xFFFF − 0x7166 = 0x8E99, the checksum. Receiver check: 0x7166 + 0x8E99 = 0xFFFF. Here IHL=5, total length=28 bytes, TTL=64 and protocol=17 (UDP). At a router TTL changes, so the checksum must be updated.

    Forouzan §7.4, datagram format, checksum and fragmentation (including Examples 7.15–7.16); slide deck 11, IPv4 Datagram Format. The checksum header values above are an original exercise.

    Worked fragmentation: 4000-byte datagram over MTU 1500

    Problem. A 4000-byte IPv4 datagram, including its 20-byte header, must cross a link with MTU 1500 bytes. Find the fragments and their offsets. Assume no options and that the router fragments it.

    1. Each fragment’s total length must be at most 1500. Subtract its 20-byte header: at most 1480 bytes of payload fit.
    2. The payload of every non-final fragment must be a multiple of 8 bytes because offsets are counted in 8-byte units. 1480 is already divisible by 8 (185 × 8), so use 1480 payload bytes for each full fragment.
    3. The original payload is 4000 − 20 = 3980 bytes. Split it as 1480 + 1480 + 1020. The last piece may be non-multiple-of-8 because no later offset needs to point past it.
    4. Fragment offsets are payload start positions divided by 8: 0/8 = 0; 1480/8 = 185; 2960/8 = 370. Total lengths add each fragment’s own 20-byte header.
    FragmentPayload bytesTotal lengthOffset (8-byte units)MF
    11480150001
    2148015001851
    3102010403700

    Check: payload total = 1480 + 1480 + 1020 = 3980; fragment total lengths = 1500 + 1500 + 1040 = 4040 because each fragment carries its own 20-byte header.

    The destination groups fragments by source address, destination address, protocol, and identification; it uses offsets and MF to place the pieces and detect the final fragment. Reassembly happens at the destination host, not at every intermediate router. If a piece is missing, the original datagram cannot be fully reassembled for the transport layer. Do not add the fragment headers to the original payload calculation: headers are overhead introduced per fragment.

    Original payload: 3980 bytes1480 B · offset 01480 B · offset 1851020 B · offset 370Total lengths with 20-byte headers: 1500 B | 1500 B | 1040 BMF flag: 1 | 1 | 0 · destination reassembles using offsets
    Offsets count payload positions in 8-byte units; each fragment gets a separate header.

    Forouzan §7.4, fragmentation and offset fields; Lecture 11, IPv4 Datagram Fragmentation.

    Longest-prefix match: choose the most specific route

    A forwarding table can summarize many destinations with CIDR prefixes. A router compares the destination address with the table entries that match, then chooses the matching prefix with the greatest number of leading bits: longest-prefix matching. The longest entry is the most specific. If no other entry matches, a default route (often written 0.0.0.0/0) can provide a next hop.

    Use this small table. The ranges are chosen so the matches can be checked by prefix:

    Destination prefixOutgoing interface / next hop
    10.0.0.0/8A
    10.1.0.0/16B
    10.1.2.0/24C
    192.168.4.0/22D
    0.0.0.0/0 (default)E
    • Destination 10.1.2.77 matches /8, /16, and /24. Choose C, because /24 is longest.
    • Destination 10.1.9.4 matches /8 and /16, but not /24. Choose B.
    • Destination 10.8.3.5 matches /8 only. Choose A.
    • Destination 192.168.5.9 falls inside 192.168.4.0/22 (the /22 range spans 192.168.4.0 through 192.168.7.255), so choose D.
    • Destination 172.16.1.2 matches none of the listed specific prefixes. Choose the default next hop E.

    Aggregation makes this manageable: an upstream router may store one organization prefix rather than a separate entry for every host. Inside the organization, more-specific prefixes can direct traffic to individual subnets. Longest-prefix match lets these broad and narrow routes coexist. Do not select the first matching row; select the matching prefix with the most bits.

    Hierarchical aggregation through Fig. 7.36. Forouzan’s regional ISP example starts with 120.14.64.0/18, a block of 16,384 addresses. It divides that block into four /20 subblocks, each containing 4096 addresses. One local ISP receives 120.14.64.0/20; the regional ISP can send that entire range toward this local ISP using one entry. The local ISP divides its /20 again: for example, its first /23 is 120.14.64.0/23, and that block can be split into /30 groups of four addresses for households. The outside Internet needs only the regional /18 route to reach the whole region; the regional ISP uses /20 entries to select a local ISP; the local ISP uses more-specific entries for its customers. This is the hierarchy: broad prefixes upstream, progressively narrower prefixes closer to the destination. A /18 contains 2^(32−18) = 16,384 addresses; a /20 contains 4096; a /23 contains 512; a /30 contains 4. The key idea is aggregation and more-specific internal forwarding, not a requirement that every router store every household route.

    Forouzan §7.4.6, “Address Aggregation” and “Hierarchical Routing,” Example 7.22 and Fig. 7.36; Kurose and Ross §4.3.2; Lecture 11, Address/Route Aggregation and Longest Prefix Matching.

    NAT: several private hosts share one public IPv4 address

    Network address translation (NAT) lets a local network use private IPv4 addresses internally while its gateway uses a public address on the Internet-facing interface. The gateway changes the outgoing packet’s source address and often its source transport port, recording a mapping. When a reply arrives, it looks up the destination public-address/port pair and restores the private destination address and port. Port multiplexing allows many simultaneous conversations to share one public IPv4 address, provided the mappings remain distinct.

    Private IPv4 blocks commonly used inside networks are 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. These are not globally routed as public destinations. A private address can be reused in separate networks; the public address is what remote Internet hosts see. NAT does not create additional globally unique addresses, and it is not the same thing as routing: it rewrites selected header values and keeps translation state.

    Worked mapping. Host 192.168.1.10 opens TCP connection from source port 51514 to web server 128.119.40.86:443. The NAT’s public address is 24.34.112.235; it assigns external port 40001. A second host 192.168.1.11 uses source port 51514 to the same server, and receives external port 40002.

    Inside local (private source)Inside global (translated source)Remote destination
    192.168.1.10:5151424.34.112.235:40001128.119.40.86:443
    192.168.1.11:5151424.34.112.235:40002128.119.40.86:443

    On the way out, the first packet’s source changes from 192.168.1.10:51514 to 24.34.112.235:40001. A reply addressed to 24.34.112.235:40001 matches the first row, so the NAT changes the destination back to 192.168.1.10:51514. The second connection returns via port 40002 to the other host. The translation table is what makes the reply unambiguous. A common trap is to say that an incoming packet can be delivered to a private host by looking only at the public IP address: when several hosts share it, the transport port and mapping matter.

    Private LAN192.168.1.10:51514192.168.1.11:51514 NAT gateway24.34.112.235ports 40001 / 40002 Internet server128.119.40.86:443 outgoing source translated; reply destination restored
    Distinct translated ports let the gateway direct each reply to its originating internal flow.

    Kurose and Ross §4.3.3 (NAT); Lecture 11, Network Address Translation.

    IPv6 and the transition from IPv4

    IPv6 expands addresses from 32 to 128 bits and uses a streamlined, fixed 40-byte base header. The base header has no header checksum. Its hop limit serves the same purpose as IPv4 TTL; next header identifies what follows, much like IPv4 protocol. IPv6 also has traffic-class and flow-label fields. A key fragmentation difference: IPv6 routers do not fragment a packet in transit; a too-large packet prompts a “packet too big” message so the sender can adjust. IPv4 fragmentation instead uses identification, flags, and offset fields as described above.

    IPv4-to-IPv6 transition is gradual because not every deployed system can interpret IPv6. Dual stack means a host or router supports both protocol versions and can use the appropriate one. Tunneling carries an IPv6 datagram as payload inside an IPv4 datagram across an IPv4-only region; the outer IPv4 Protocol value is 41 to indicate IPv6. At the far tunnel endpoint, the IPv4 wrapper is removed and the IPv6 packet continues. Header translation converts between IPv6 and IPv4 header formats when one side cannot understand the other version; translation has to account for differences in fields and capabilities, not merely swap address widths.

    IPv6 sendernative packet IPv4-only region (tunnel)IPv4 header | IPv6 packet payload IPv6 receivernative packet encapsulatedecapsulate
    Tunneling wraps an IPv6 packet for transit; header translation is a separate conversion strategy.

    Kurose and Ross §4.3.4 (IPv6); Forouzan §7.6, “Transition from IPv4 to IPv6” (dual stack, tunneling, header translation); Lecture 11, IPv6 Datagram Format and Transitioning from IPv4 to IPv6.

    Quick recall

    What is forwarding, and what is routing?
    Forwarding chooses an output interface for one packet at one router. Routing determines network-wide paths and supplies the forwarding information routers use.
    Does best-effort IP guarantee that packets arrive in order?
    No. IP makes no delivery or ordering guarantee; a higher layer can provide reliability when needed.
    If IHL is 7, how many header bytes are present?
    7 × 4 = 28 bytes. IHL counts 4-byte words.
    Why must each non-final IPv4 fragment’s payload be divisible by 8?
    The fragment offset is measured in 8-byte units, so later fragment start positions must be representable in those units.
    Who reassembles IPv4 fragments?
    The destination host reassembles them before passing the datagram payload to the transport layer.
    A destination matches /8 and /24 entries. Which one wins?
    The /24 entry, because it is the longest (most specific) matching prefix.
    How does NAT distinguish two internal flows using one public address?
    It records distinct translated transport ports (and associated flow mapping state), then uses the reply’s public port to find the internal destination.
    What does IPv6 tunneling do across an IPv4-only region?
    It encapsulates the IPv6 packet in an IPv4 packet (Protocol value 41) and removes that outer wrapper at the tunnel endpoint.

    Recall checks review Kurose and Ross §§4.1, 4.3; Forouzan §§7.4 and 7.6; Lecture 11.

    Routing algorithms: choosing paths through the network

    A router forwards one packet using local information; a routing algorithm helps determine which local choices will carry packets toward their destinations across the network. This chapter turns “find a good route” into a graph problem, then studies two ways to solve it: link-state (LS), which gathers a network-wide view, and distance-vector (DV), which learns through neighbors.

    Control plane and network graph

    The data plane applies a router’s forwarding entries to arriving packets. The control plane supplies the network-wide logic: it determines how packets should travel across routers and can configure network components. A destination-based forwarding table maps destination prefixes to next hops. In SDN, a logically centralized controller computes or manages forwarding rules and installs them through a control agent; in traditional per-router control, routers run routing logic and exchange information with one another. In both cases, packets still need local forwarding at each router.

    Represent a network as a graph G = (V, E): vertices V are routers, and edges E are links between neighboring routers. Give each edge a cost c(u,v). Cost can model a configured administrative preference, distance, monetary expense, capacity, or some other metric. A nonexistent link can be treated as cost ∞. The cost of a path is the sum of its link costs; a least-cost route minimizes that sum. Cost is not necessarily physical distance or milliseconds, and the “best” path depends on the metric chosen by the network.

    ABCDE 42158210
    Example graph used for Dijkstra’s calculation below. The numbers are link costs.

    Routing algorithms can be classified along several independent axes. Centralized (often LS) algorithms use a complete topology-and-cost view at the node running the calculation. Decentralized (often DV) algorithms learn from directly connected neighbors. Static routes change slowly, often after a human changes configuration; dynamic algorithms react to topology or metric changes. A dynamic algorithm can adapt quickly, but changes can also cause loops or oscillation. A load-sensitive metric changes with congestion; a load-insensitive metric does not react to current traffic load. Load-sensitive routing can be unstable: traffic moves away from a busy path, makes another path look busy, and then moves back.

    Worked load-sensitive oscillation. Consider two equal-cost alternative paths, P and Q, carrying two source-destination flows. Assume a path costs 1 when it carries at most one flow and 5 when both flows use it; each flow chooses the cheaper path using the current costs, and both update routes at the same time. If both flows start on P, then P costs 5 and Q costs 1, so both move to Q. Now Q costs 5 and P costs 1, so both move back to P. This repeats: each path alternates between empty/cheap and full/expensive because every flow reacts to the same current load. This simplified synchronous example shows why using load-sensitive metrics can cause route oscillation; real protocols may update at different times and the exact outcome depends on the metric and timing.

    Kurose and Ross §5.1; Lecture 12, Routing Algorithms and Route Oscillation Example. The two-path numbers are an original illustration of the slide’s load-sensitive oscillation concept.

    Link-state: learn the graph, then run Dijkstra

    In link-state routing, routers distribute link-state information so that each router can build a topology view containing links and their costs. Given a consistent view, each router can independently calculate shortest paths from itself. Dijkstra’s algorithm grows a set N′ of nodes whose least-cost paths from the source are settled. It repeatedly selects the unsettled node with the smallest tentative distance, adds it to N′, then checks whether reaching each neighbor through that node improves the neighbor’s current estimate.

    Let D(v) be the current best-known cost from source A to v, and p(v) the predecessor on that tentative path. When a node w is settled, update each unsettled neighbor v using D(v) = min(D(v), D(w) + c(w,v)). Once all nodes are settled, the predecessor links reconstruct paths. A router’s forwarding entry uses the first neighbor on that complete path as its next hop.

    Worked example. Use the graph above, start at A, and calculate shortest paths to B, C, D, and E. Initial estimates come only from A’s direct links: D(B)=4, D(C)=2, D(D)=∞, D(E)=∞. Parentheses below show the predecessor for each finite estimate.

    StepSettled set N′D(B)D(C)D(D)D(E)Why it changes
    Initialize{A}4 (A)2 (A)∞∞Known direct links from A.
    1: settle C{A,C}3 (C)2 (A)10 (C)12 (C)A→C costs 2; via C: B=2+1, D=2+8, E=2+10.
    2: settle B{A,C,B}3 (C)2 (A)8 (B)12 (C)Via B, D=3+5=8, improving 10.
    3: settle D{A,C,B,D}3 (C)2 (A)8 (B)10 (D)Via D, E=8+2=10, improving 12.
    4: settle E{A,C,B,D,E}3 (C)2 (A)8 (B)10 (D)All vertices are settled.

    Now trace predecessors to make paths: B has predecessor C, and C has predecessor A, so A→C→B costs 2+1=3. D’s predecessor is B, so A→C→B→D costs 2+1+5=8. E’s predecessor is D, so A→C→B→D→E costs 10. The resulting forwarding table at A is:

    DestinationLeast cost from AFull pathNext hop at A
    B3A→C→BC
    C2A→CC
    D8A→C→B→DC
    E10A→C→B→D→EC

    Notice the difference between a predecessor and the forwarding next hop. The predecessor of D is B, but A does not forward directly to B; A first sends the packet to C. A path’s first edge determines the local next hop. Also, costs—not number of links—decide the winner: A→B costs 4, but A→C→B costs 3.

    ACBDE+2+1+5+2023810
    The predecessor tree records the winning paths; all destinations happen to use next hop C from A.

    With a simple array-based search for the lowest tentative distance, Dijkstra’s running time is O(V²) in the common simplified analysis. A heap-based implementation is often described as O((V+E) log V), depending on the data structure and graph representation. These are algorithm implementation bounds, not a guarantee about how long a network takes to exchange link-state information. The lecture’s simpler bound counts repeated scans of the vertices.

    Kurose and Ross §5.2.1; Lecture 12, Link-State Routing Algorithm and Dijkstra’s Algorithm. Graph and values in this worked example are original for this guide.

    Distance-vector: learn routes from neighbors

    Distance-vector routing is decentralized, iterative, and asynchronous. Each router knows the costs of its directly attached links and receives distance estimates from its neighbors. For destination y, the Bellman–Ford relationship says the least cost from x is the minimum, over neighbors v, of the direct cost from x to v plus v’s advertised distance to y:

    dx(y) = minv ∈ neighbors(x) { c(x,v) + dv(y) }

    In practice, each node stores estimates Dx(y) and updates them when a neighbor sends a new vector or a local link cost changes. The neighbor that achieves the minimum becomes the next hop for y. Nodes send changed estimates to their neighbors, repeat the calculation, and stop sending updates when values stabilize. The procedure does not require all routers to update at precisely the same instant.

    Worked convergence over synchronous rounds. Use the four-node line A—B—C—D with link costs A–B=1, B–C=2, C–D=1, and an additional direct A–D link of cost 7. Each vector is ordered (distance to A, B, C, D). At round 0, each node knows only its directly attached links (and distance zero to itself). For this table only, define one synchronous round as every node updating from the neighbor vectors frozen at the end of the previous round; this makes the arithmetic easy to trace. Actual distance-vector routing exchanges updates asynchronously.

    RoundRouterDistance vector (A, B, C, D)Example update
    0A(0, 1, ∞, 7)Direct links only.
    0B(1, 0, 2, ∞)Direct links only.
    0C(∞, 2, 0, 1)Direct links only.
    0D(7, ∞, 1, 0)Direct links only.
    1A(0, 1, 3, 7)To C via B: 1+2=3; direct A–D remains 7.
    1B(1, 0, 2, 3)To D via C: 2+1=3.
    1C(3, 2, 0, 1)To A via B: 2+1=3.
    1D(7, 3, 1, 0)To B via C: 1+2=3.
    2A(0, 1, 3, 4)To D via B using round-1 vector: 1+3=4, beating direct cost 7.
    2B(1, 0, 2, 3)No estimate improves.
    2C(3, 2, 0, 1)No estimate improves.
    2D(4, 3, 1, 0)To A via C using round-1 vector: 1+3=4.
    3 (stable)A(0, 1, 3, 4)Values do not change.
    3 (stable)B(1, 0, 2, 3)Values do not change.
    3 (stable)C(3, 2, 0, 1)Values do not change.
    3 (stable)D(4, 3, 1, 0)Values do not change.

    For example, A initially estimates the route to D as 7 on its direct edge. In round 1, A learns from B that B-to-D costs ∞, so that route cannot yet improve. After B learns in round 1 that D is reachable through C for cost 3, A uses that previous-round advertisement in round 2: A-to-B 1 plus B-to-D 3 gives 4. Symmetrically, D learns a cost-4 route to A through C. The stable vectors give each node its least costs and, by recording which neighbor produced each minimum, its next hops.

    Small numeric update. In a line X—Y—Z, suppose c(X,Y)=4 and c(Y,Z)=3. Y currently advertises DY(Z)=3. X’s direct distance to Z is ∞, so its candidate through Y is 4+3=7. X therefore sets DX(Z)=7 and installs Y as the next hop to Z. This is one Bellman–Ford update: local link cost plus the neighbor’s advertised distance. If Y later advertises 5 after its own route changes, X recomputes 4+5=9 and may update its entry.

    XYZlink cost 4link cost 3Y advertises Dᵧ(Z)=3; X computes 4+3=7 via Y
    Each node combines its own link cost with a neighbor’s advertised distance.

    Kurose and Ross §5.2.2; Lecture 12, Distance-Vector Routing Algorithm. The X—Y—Z arithmetic is an original explanatory example.

    Bad news travels slowly: count to infinity

    A DV node’s estimate can be wrong when a neighbor’s route actually loops back through it. The classic bad-news example has three routers: x—y with cost 4 initially, y—z with cost 1, and z—x with cost 50. Before a change, y reaches x directly at cost 4; z reaches x through y at cost 1+4=5. Now the x–y link cost rises from 4 to 60. Once the estimates converge, y should reach x through z at cost 1+50=51, which is cheaper than the direct cost 60. The transient loop occurs because y and z initially rely on stale estimates instead of this current route.

    Follow the asynchronous updates as presented in the lecture. Before the increase, Dy(x)=4 and Dz(x)=5. At t0, y detects the direct link increase to 60 but still has z’s old advertisement, 5. It calculates min(60, 1+5)=6 and selects z. That estimate is stale: z’s route to x used y, so y is now routing to z while z routes to y. At t1, z hears 6 and calculates min(50, 1+6)=7 via y. Then y hears 7 and calculates 8; z hears 8 and calculates 9; the two advertised estimates rise one at a time.

    Update eventY’s estimate to xZ’s estimate to xReason
    Before failure/metric rise4 direct5 via YY–X=4; Z–Y–X=1+4.
    Y detects cost 4→606 via Z5 (stale, via Y)Y computes min(60, 1+5).
    Z hears Y=66 via Z7 via YZ computes min(50, 1+6).
    Y hears Z=78 via Z7 via YY computes min(60, 1+7).
    Further alternating updates8, 10, 12, …9, 11, 13, …Each router’s estimate rises by 1 after it hears the other’s increase.
    Eventually Z sees via Y exceed 5051 via Z50 directZ chooses its direct 50 link; then Y chooses 1+50=51.

    This phenomenon is called count to infinity: estimates increase through repeated exchanges until a node finally prefers its direct route or reaches the protocol’s defined infinity. The sequence is a routing loop during convergence, not a real sequence of physical link costs. With y–z=1 and z–x=50, the converged least-cost y–x route is 51, not 60.

    Poisoned reverse partially prevents this two-node loop. If z reaches x through y, z advertises Dz(x)=∞ specifically to y. When y’s direct x-link changes from 4 to 60, its poisoned neighbor advertisement means y will not treat z’s old “5” as an independent path; y selects the direct 60 route and tells z. Z then uses its direct cost 50 and advertises 50 to y. Y switches to cost 51 through z and, in turn, advertises ∞ back to z for destination x. Poisoned reverse hides a route from the neighbor that is already on that route. It is only a partial fix: loops involving three or more routers may remain.

    Trap: the phrase “good news travels fast, bad news travels slowly” describes a convergence problem, not a claim that every DV update is slow. A new short route can be adopted quickly; withdrawal or worsening of a route can leave stale neighbor estimates that feed a loop.

    Kurose and Ross §5.2.2 (Bellman–Ford, count to infinity, poisoned reverse); Lecture 12, Distance-Vector Routing Algorithm and the x–y–z bad-news example.

    LS and DV: what information is available?

    QuestionLink-state (LS)Distance-vector (DV)
    What does a router learn?Topology and link costs across the network through link-state distribution.Its own link costs and neighbors’ advertised distance vectors.
    Where does calculation happen?Each router can independently run Dijkstra on the shared graph.Each router updates from neighbor information using Bellman–Ford.
    Information patternNetwork-wide view (centralized computation, even if every router runs it).Distributed, iterative, and asynchronous neighbor exchange.
    Characteristic issueMust distribute and maintain a consistent topology view; simple Dijkstra may use O(V²).Stale estimates can create loops and count-to-infinity behavior; poisoned reverse helps only in some cases.
    Complexity shorthandO(V²) for simple scanning; commonly O((V+E) log V) with a heap implementation.Depends on graph, update schedule, and convergence; no single fixed per-router bound captures all message rounds.

    Do not confuse “centralized versus decentralized control” with “forwarding versus routing.” Forwarding is the local action in every router. Control can be per-router or logically centralized. LS versus DV describes how a routing algorithm obtains and uses information. These are related classifications, but they answer different questions.

    Kurose and Ross §§5.1–5.2; Lecture 12, Routing Algorithms and LS/DV descriptions.

    Quick recall

    What do vertices and edges represent in the routing graph?
    Vertices represent routers; edges represent links between neighboring routers. Edge costs define the metric used to compare paths.
    What does Dijkstra settle on each iteration?
    It adds the unsettled node with the smallest tentative path cost to the finalized set, then tries routes through that node to improve neighbors’ estimates.
    In the worked example, why is A’s next hop to D equal to C if D’s predecessor is B?
    A’s full path is A→C→B→D. B is the predecessor of D, but the first hop from A is C.
    State the Bellman–Ford update for X reaching destination Z via neighbor Y.
    Add the local link cost c(X,Y) to Y’s advertised distance Dᵧ(Z), then compare this candidate with other neighbors’ candidates.
    Why can DV create a two-router loop after a route becomes worse?
    Each router can mistake the other’s stale estimate for an independent path, so each chooses the other as next hop and raises its advertised distance over repeated updates.
    What does poisoned reverse advertise to a neighbor?
    If a router’s route to a destination uses that neighbor, it advertises an infinite distance to that neighbor for that destination, discouraging a two-node loop.
    Does poisoned reverse prevent every possible routing loop?
    No. It addresses some two-node loops; loops involving three or more routers can still occur.
    What is one difference between LS and DV information exchange?
    LS distributes link/topology information for a network-wide view; DV exchanges distance estimates between directly connected neighbors.

    Recall checks review Kurose and Ross §§5.1–5.2 and Lecture 12.

    Check your subnet arithmetic

    Do it on paper first. Then use this to catch mask, boundary and host-count mistakes.

    Example: 172.16.35.123/20. Four decimal octets (0–255), then /0 to /32.

    Can you explain it without the notes?

    Spend 20–30 minutes here after reading. These are original practice questions, not a prediction of your quiz. Commit to an answer before checking.

    0 of 16 answered

    Paper practice: show the working

    For these, the intermediate steps matter as much as the final answer.

    1. Find the network, broadcast and conventional usable range for 172.16.35.123/20.

    /20 → mask 255.255.240.0. The third octet advances in blocks of 16; 35 falls in 32–47. Network 172.16.32.0, broadcast 172.16.47.255. There are 2¹² = 4096 total addresses; conventional usable range 172.16.32.1–172.16.47.254, 4094 hosts.

    2. Allocate subnets for 60, 28 and 12 usable hosts inside 192.168.4.0/24.

    Include network and broadcast in the required block. 60+2 → 64 addresses (/26), 28+2 → 32 (/27), 12+2 → 16 (/28). Largest first: 192.168.4.0/26 (.0–.63), 192.168.4.64/27 (.64–.95), 192.168.4.96/28 (.96–.111). The reserve is .112–.255, a range rather than one aligned CIDR block. Usable hosts exclude each subnet’s first and last addresses.

    3. A switch receives A→B at port 1, B→A at port 2, and A→B at port 1. Start with an empty table.

    First learn A→1 and flood the unknown B to all ports except 1. Next learn B→2; A is known on 1, so forward only to 1. Finally refresh A→1 and forward B’s frame only to 2. The switch learned from source addresses.

    4. Fragment a 3000-byte IPv4 datagram (20-byte header) for MTU 1000. Give total lengths, offsets and MF.

    Payload = 2980. A non-final fragment can carry floor((1000−20)/8)×8 = 976 bytes. Payloads: 976, 976, 976, 52. Total lengths: 996, 996, 996, 72. Offsets: 0, 122, 244, 366. MF: 1, 1, 1, 0. The first three fragments are smaller than the MTU to preserve eight-byte alignment.

    5. Routes are 10.0.0.0/8→A, 10.2.0.0/16→B, 10.2.3.0/24→C, default→D. Forward 10.2.3.9, 10.2.8.1, 10.9.1.1 and 11.0.0.1.

    Choose the longest matching prefix: C, B, A, D respectively. A route’s prefix length beats its visual position in an unsorted table. A default route matches only as the fallback when no more-specific route applies.

    6. A can reach destination D via B (link cost 2, B advertises 6) or C (link cost 5, C advertises 1). What is A’s new DV entry?

    Via B: 2+6=8. Via C: 5+1=6. Thus D_A(D)=6 via C. Choose the minimum total, not the neighbor with the smallest link cost. Advertisements may be stale; DV converges through further exchanges.

    Your last 10 minutes

    Say these aloud. If you cannot justify a line, return to its worked example.

    Addressing

    • IPv4 addresses identify interfaces; IPv4 is 32 bits, Ethernet MAC is 48 bits.
    • /n has 232−n total addresses. Ordinary subnet usable count is total−2.
    • Network = IP AND mask. Last address = network OR inverted mask.
    • VLSM: round up, largest first, align, check overlaps.
    • Aggregation needs contiguous blocks with the correct shared prefix and alignment.

    Delivery

    • Switch: learn source MAC, look up destination MAC.
    • Unknown destination: flood except ingress. Known on ingress: filter.
    • Remote destination? ARP for the local gateway’s MAC.
    • IP stays end to end in ordinary routing; link-layer addresses change each hop.
    • Hub shares a collision domain; switches separate it per link. Routers separate broadcast domains.

    Packet processing

    • Forwarding is a local decision; routing computes the network paths.
    • IPv4 IHL counts four-byte words. Total length includes header.
    • Fragment offset counts eight-byte payload units; MF=0 identifies the last fragment.
    • TTL decreases at routers; IPv4 header checksum changes.
    • NAT uses address/port mappings; longest matching prefix wins.

    Route computation

    • Dijkstra: finalize smallest tentative cost; relax its neighbors.
    • DV: min over neighbors of link cost + advertised distance.
    • Next hop is the first neighbor on the path, not the destination’s predecessor.
    • LS knows topology; DV learns estimates from neighbors.
    • Poisoned reverse prevents a two-router dependency loop; longer loops can remain.
    Exam answer structure: definition → why it is needed → labeled sketch or table → calculation → units and conclusion.

    What this guide covers

    The screenshot is the authority for textbook boundaries. Slides 8–12 provide the professor’s emphasis and explanation style. Cross references below let you return to the local originals.

    Assigned sourceCovered hereBoundary
    Forouzan 2022 §6.1Hubs, switches, routers; learning and loop prevention§6.1 only
    Forouzan §7.4IPv4 addressing, main/auxiliary protocols, forwardingExclude §§7.4.3–7.4.5; §7.4.6 only through Fig. 7.36
    Forouzan §7.6Dual stack, tunneling, header translationTransition from IPv4 to IPv6
    Forouzan §§8.1–8.2Graphs, least-cost routing, DV and LS/DijkstraStop at Fig. 8.10; path-vector section excluded
    Kurose & Ross 2021 §§4.1, 4.3Network layer overview, IPv4, addressing/DHCP, NAT, IPv6Router internals §4.2 and generalized forwarding §4.4 are not assigned textbook sections
    Kurose & Ross §§5.1, 5.2Control plane, LS and DV, link changes and poisoned reverseNo protocol-specific OSPF/BGP deep dive
    Slides 8–12IP addresses; MAC addresses/ARP; connecting devices; data plane; control planeAll five present in SLIDES/

    Files inspected

    • SLIDES/8_Layer_3_IP_Addresses.pdf
    • SLIDES/9_Layer_2_MAC_Addresses.pdf
    • SLIDES/10_CONNECTING_DEVICES.pdf
    • SLIDES/11_Network_Layer_Data_Plane.html
    • SLIDES/12_Network_Layer_Control_Plane.html
    • BOOKS/1_Behrouz A. Forouzan … (2022).pdf
    • BOOKS/2_James W. Kurose, Keith W. Ross … (2021).pdf

    These are original explanatory notes and original diagrams derived from your supplied materials. Textbooks and slide decks are not republished. Modern caveats are marked where classroom simplifications could otherwise mislead. Exact quiz questions and lecture-only additions are unknown.

    DCN Quiz 2 · Plain language first, precise definition next

    Definitions you can explain

    Use the short meaning to get the idea. Open the details for the formal definition, an example and the distinction your professor could test.

    Start with layer, protocol, service, encapsulation, then compare IP address, MAC address and port number.

    82 definitions

    Application

    Application layer

    The layer where networked programs define the meaning of requests and responses.

    Formal meaning, example & common confusion
    Formal definition
    The top layer of the Internet stack, containing protocols used directly by applications, such as HTTP, DNS, and DHCP.
    Example
    A browser and web server exchange HTTP messages at the application layer.
    Do not confuse it with…
    Applications can rely on lower-layer services; they do not need to implement link delivery themselves.

    Across layers

    ARP

    On an IPv4 local network, ARP helps find the link-layer address associated with a nearby IP address.

    Formal meaning, example & common confusion
    Formal definition
    The Address Resolution Protocol resolves an IPv4 protocol address to a link-layer address on the local subnet.
    Example
    Before sending a frame to a local neighbor, a host may broadcast an ARP request asking who has a particular IPv4 address.
    Do not confuse it with…
    ARP sits at the L2/L3 boundary: it uses IP information to learn a MAC address, and its broadcast is local to the subnet.

    Across layers

    Bandwidth

    A measure of how much data a link can carry per unit time, often stated in bits per second.

    Formal meaning, example & common confusion
    Formal definition
    The capacity or configured data rate of a communication channel, commonly expressed in b/s or multiples thereof.
    Example
    A 100 Mb/s link has a higher nominal data rate than a 10 Mb/s link.
    Do not confuse it with…
    Bandwidth is capacity, not the time a particular packet takes to arrive; that is latency.

    Network

    Bellman-Ford relation

    A shortest-path rule: the best route to a destination can be found by trying each neighbor as the first step.

    Formal meaning, example & common confusion
    Formal definition
    The recurrence D_x(y) = min_v { c(x,v) + D_v(y) }, expressing node x's least cost to y through a neighbor v.
    Example
    If a destination costs 5 through one neighbor and 3 through another, the router chooses the cheaper total.
    Do not confuse it with…
    The relation underlies distance-vector updates; it is not the same algorithmic procedure as Dijkstra's.

    Physical

    Bit

    A 0 or 1, the smallest unit of digital information represented in a network signal.

    Formal meaning, example & common confusion
    Formal definition
    A binary digit encoded physically through a medium using a signaling scheme.
    Example
    A fiber link represents a bit pattern as changes in light.
    Do not confuse it with…
    Bits are the information; electrical, radio, or optical signals are how those bits are represented physically.

    Data link

    Bridge

    A device that joins LAN segments and forwards frames using link-layer addresses.

    Formal meaning, example & common confusion
    Formal definition
    A data-link forwarding device that connects LAN segments and filters frames based on MAC addresses.
    Example
    A bridge can join two Ethernet segments into one link-layer network.
    Do not confuse it with…
    A bridge forwards frames within link-layer scope; a router connects distinct IP networks.

    Across layers

    Checksum

    A calculated value used to detect some accidental changes to transmitted data.

    Formal meaning, example & common confusion
    Formal definition
    A value computed over selected fields or bytes and checked by the receiver for integrity errors.
    Example
    IPv4 includes a header checksum; Ethernet uses a frame check sequence for error detection.
    Do not confuse it with…
    A checksum can detect many errors but is not encryption and does not guarantee correction.

    Network

    CIDR

    A way to write an IP address block with its prefix length after a slash.

    Formal meaning, example & common confusion
    Formal definition
    Classless Inter-Domain Routing represents variable-length IP prefixes, such as 203.0.113.0/24.
    Example
    A /26 has 6 suffix bits and 64 total IPv4 address patterns.
    Do not confuse it with…
    The number after the slash is prefix bits, not the usable host count.

    Across layers

    Connectionless

    A communication style where each unit can be sent without first creating a lasting transport connection.

    Formal meaning, example & common confusion
    Formal definition
    A service model in which data units are transmitted independently without transport-level connection setup or maintained session state.
    Example
    UDP sends datagrams without establishing a TCP connection first.
    Do not confuse it with…
    Connectionless communication can still use source and destination addresses, and applications can add their own state.

    Network

    Control plane

    The part of networking that figures out or manages where traffic should go.

    Formal meaning, example & common confusion
    Formal definition
    Functions that determine routes, maintain network state, and install forwarding information in devices.
    Example
    A routing algorithm calculates the next hops that routers use in their data planes.
    Do not confuse it with…
    Control-plane decisions influence forwarding, but they are not the forwarding of each individual packet.

    Network

    Data plane

    The part of a router that handles packets as they arrive and sends them onward.

    Formal meaning, example & common confusion
    Formal definition
    The forwarding functions that process packets locally according to installed forwarding state.
    Example
    A router's data plane looks up a destination prefix and selects an output interface.
    Do not confuse it with…
    The data plane forwards; the control plane computes or manages the rules it uses.

    Across layers

    Decapsulation

    As data moves up the receiving stack, each layer reads and removes its own wrapper.

    Formal meaning, example & common confusion
    Formal definition
    The receiving-side process of processing a layer's control information and passing its payload upward.
    Example
    A receiver checks the frame, removes its link header, then IP processes the datagram inside.
    Do not confuse it with…
    Decapsulation occurs layer by layer; the application does not normally strip the Ethernet header itself.

    Network

    Default gateway

    The local router a host sends packets to when the destination is outside its own subnet.

    Formal meaning, example & common confusion
    Formal definition
    A host's configured next-hop router used for destinations lacking a more specific local route.
    Example
    A laptop sends an Internet-bound packet to its Wi-Fi router as the default gateway.
    Do not confuse it with…
    The gateway is the next local step, not necessarily the final destination or the entire route.

    Application

    DHCP

    A protocol that lets a device automatically obtain an address and other network settings.

    Formal meaning, example & common confusion
    Formal definition
    The Dynamic Host Configuration Protocol configures hosts with parameters such as IP address, subnet mask, gateway, and DNS server.
    Example
    A laptop joining campus Wi-Fi broadcasts a request and receives a leased address.
    Do not confuse it with…
    DHCP is an application-layer protocol despite configuring network-layer settings.

    Network

    Dijkstra's algorithm

    A method for finding least-cost paths from one starting router when link costs are known.

    Formal meaning, example & common confusion
    Formal definition
    An iterative shortest-path algorithm that finalizes the least-cost path to the nearest unsettled node at each step, for nonnegative edge costs.
    Example
    A link-state router can run Dijkstra over its topology map to build next-hop choices.
    Do not confuse it with…
    Dijkstra is a path-computation algorithm, not a message protocol by itself.

    Network

    Directed broadcast

    An IP destination that targets all hosts on a particular subnet by setting its suffix bits to 1.

    Formal meaning, example & common confusion
    Formal definition
    The subnet-directed broadcast address is the address with the subnet prefix and an all-ones host portion.
    Example
    192.168.1.127 is the directed broadcast for 192.168.1.64/26.
    Do not confuse it with…
    It differs from 255.255.255.255, the limited broadcast; routers may forward directed broadcasts subject to policy.

    Network

    Distance-vector (DV) routing

    A routing approach where each router tells neighbors its current estimated costs to destinations.

    Formal meaning, example & common confusion
    Formal definition
    A distributed routing algorithm that updates distance estimates using neighbor information and the Bellman-Ford relation.
    Example
    A router compares the cost through each neighbor and selects the least-cost next hop.
    Do not confuse it with…
    DV exchanges destination costs with neighbors rather than distributing a complete topology map.

    Application

    DNS

    The naming system that helps find an IP address or other records associated with a domain name.

    Formal meaning, example & common confusion
    Formal definition
    The Domain Name System is a distributed hierarchical naming database and application protocol.
    Example
    A resolver looks up the address records for example.com before a browser connects.
    Do not confuse it with…
    DNS is an application-layer protocol even though its answers help the network locate a destination.

    Across layers

    Encapsulation

    As data moves down the sending stack, each layer wraps it with its own control information.

    Formal meaning, example & common confusion
    Formal definition
    The process by which a protocol adds a header and, in some layers, a trailer to data received from above.
    Example
    An application message gets a TCP header, then an IP header, then a link header and trailer.
    Do not confuse it with…
    The lower layer carries the upper layer's whole unit as payload; it does not reinterpret the application meaning.

    Data link

    Ethernet

    A common family of wired LAN technologies that defines frame formats and link behavior.

    Formal meaning, example & common confusion
    Formal definition
    IEEE 802.3 technologies specify physical and data-link operation for Ethernet networks.
    Example
    A desktop sends an IP datagram inside an Ethernet frame to its local router.
    Do not confuse it with…
    Ethernet is a link technology; it does not determine the end-to-end IP route by itself.

    Physical

    Fiber optic cable

    A cable that carries information as light through thin glass or plastic strands.

    Formal meaning, example & common confusion
    Formal definition
    An optical transmission medium that propagates modulated light signals between transceivers.
    Example
    A long-distance network link may use fiber to carry high-rate signals.
    Do not confuse it with…
    Fiber is a physical medium; the protocols carried over it can still be Ethernet and IP.

    Network

    Forwarding

    The router's local act of choosing where to send one arriving packet next.

    Formal meaning, example & common confusion
    Formal definition
    The data-plane operation that maps an input packet and destination to an outgoing interface or next hop.
    Example
    A router forwards a datagram out the ISP-facing interface after a table lookup.
    Do not confuse it with…
    Forwarding handles individual packets; routing computes paths and builds forwarding information.

    Network

    Forwarding table

    A router's lookup list mapping destination networks to outgoing interfaces or next hops.

    Formal meaning, example & common confusion
    Formal definition
    A data-plane table used to select packet forwarding actions, often with longest-prefix matching.
    Example
    A row for 203.0.113.0/24 may direct packets out a particular interface.
    Do not confuse it with…
    A forwarding table is used for packet delivery; routing protocols and algorithms create or update its contents.

    Network

    Fragment offset

    A field that says where a fragment's data belongs within the original IP datagram.

    Formal meaning, example & common confusion
    Formal definition
    The IPv4 fragment-offset field locates fragment payload in units of eight bytes relative to the original datagram payload.
    Example
    A later fragment has a nonzero offset indicating that earlier payload bytes came before it.
    Do not confuse it with…
    The offset is not a byte count in every representation; IPv4 encodes it in eight-byte units.

    Network

    Fragmentation

    Splitting a large IP datagram into smaller pieces so it can cross a link with a smaller MTU.

    Formal meaning, example & common confusion
    Formal definition
    The division of an IP datagram into fragments that are reassembled by the destination; IPv4 and IPv6 handle router fragmentation differently.
    Example
    An IPv4 datagram may be fragmented when it is too large for a link and fragmentation is allowed.
    Do not confuse it with…
    A fragment is not a complete application message; all required pieces must arrive for reassembly.

    Data link

    Frame

    A link-layer unit sent across one local network link, with link control information around its payload.

    Formal meaning, example & common confusion
    Formal definition
    A data-link PDU with a link header and commonly a trailer, encapsulating a network-layer packet.
    Example
    An Ethernet frame can carry an IP datagram to the next router.
    Do not confuse it with…
    The frame is link-local; the IP datagram inside may continue across many links.

    Across layers

    Header

    Control information placed before a protocol's carried data.

    Formal meaning, example & common confusion
    Formal definition
    A protocol-specific field sequence preceding the payload in a protocol data unit.
    Example
    An IP header contains source and destination IP addresses.
    Do not confuse it with…
    A header belongs to a layer's protocol; it is not the payload from that layer's point of view.

    Application

    HTTP

    A web protocol for requests and responses, such as asking for a page or sending form data.

    Formal meaning, example & common confusion
    Formal definition
    The Hypertext Transfer Protocol defines application messages and semantics for transferring web resources.
    Example
    A browser sends an HTTP request for a page and receives an HTTP response.
    Do not confuse it with…
    HTTPS commonly means HTTP protected by TLS, but HTTP/3 uses QUIC rather than TCP; HTTP is not tied to one transport in every version.

    Physical

    Hub

    A simple multiport device that repeats incoming signal energy out its other ports.

    Formal meaning, example & common confusion
    Formal definition
    A physical-layer repeater with multiple ports; it does not inspect destination MAC addresses.
    Example
    A hub sends a received bit pattern to every connected station except the incoming port.
    Do not confuse it with…
    Unlike a switch, a hub does not learn addresses or filter frames.

    Network

    ICMP

    A network-layer companion protocol used for IP error reports and diagnostic messages.

    Formal meaning, example & common confusion
    Formal definition
    The Internet Control Message Protocol carries control and error messages associated with IP delivery.
    Example
    A ping test commonly uses ICMP Echo messages carried inside IP packets.
    Do not confuse it with…
    ICMP is carried inside IP and operates at the network layer; it is not a transport protocol with application ports.

    Across layers

    Interface

    The word has two common meanings: a connection point on a device, or a boundary where layers exchange data.

    Formal meaning, example & common confusion
    Formal definition
    A device interface is a network attachment point; a layer interface specifies how adjacent layers access each other's services.
    Example
    A router has several network interfaces; the transport-to-network interface passes a segment for delivery.
    Do not confuse it with…
    Do not confuse a router's physical or logical network port with the abstract interface between protocol layers.

    Network

    IP

    The Internet Protocol family that carries datagrams between networks using IP addresses.

    Formal meaning, example & common confusion
    Formal definition
    A network-layer protocol providing connectionless, best-effort datagram delivery and addressing across interconnected networks.
    Example
    A router examines an IP destination and forwards the datagram toward the next network.
    Do not confuse it with…
    IP does not provide TCP's reliable ordered byte stream; reliability can be added by a higher layer.

    Network

    IP address

    A network-layer address assigned to an interface so packets can be delivered across networks.

    Formal meaning, example & common confusion
    Formal definition
    A logical address used by IP for source and destination identification and forwarding; the address format depends on IP version.
    Example
    A router has a different IP address on each of its network interfaces.
    Do not confuse it with…
    The IP address is not a port number or MAC address: the three identify different scopes and jobs.

    Network

    IP datagram

    A network-layer packet with IP addresses and data to deliver across networks.

    Formal meaning, example & common confusion
    Formal definition
    An IP packet containing an IP header and payload, forwarded toward a destination address.
    Example
    An IP datagram can carry a TCP segment or a UDP datagram.
    Do not confuse it with…
    Routers forward IP datagrams; each link carries them inside a link-layer frame.

    Network

    IPv4

    The widely used IP version with 32-bit addresses, usually written as four decimal octets.

    Formal meaning, example & common confusion
    Formal definition
    Internet Protocol version 4, whose addresses are 32 bits and whose packets use an IPv4 header.
    Example
    192.0.2.8 is an IPv4 address written in dotted-decimal form.
    Do not confuse it with…
    An IP address belongs to a network interface; it is not a permanent identity for the whole device.

    Network

    IPv6

    A newer IP version with 128-bit addresses, designed in part to provide a much larger address space.

    Formal meaning, example & common confusion
    Formal definition
    Internet Protocol version 6, using 128-bit addresses and an IPv6 packet header.
    Example
    An IPv6 address is written in hexadecimal groups separated by colons.
    Do not confuse it with…
    IPv6 is not simply a longer IPv4 address; it has its own packet format and address notation.

    Across layers

    Latency

    The time it takes data to travel from one point to another, including relevant waiting and processing.

    Formal meaning, example & common confusion
    Formal definition
    End-to-end or per-hop delay, commonly composed of transmission, propagation, processing, and queueing delays.
    Example
    A 30 ms round-trip latency means a request and response take about 30 milliseconds to complete the round trip.
    Do not confuse it with…
    A link can have high bandwidth and still have high latency, such as a fast long-distance path.

    Across layers

    Layer

    A way to group networking jobs so each group can be explained and changed separately.

    Formal meaning, example & common confusion
    Formal definition
    A conceptual level in a layered network architecture, with defined responsibilities and interactions with adjacent levels.
    Example
    The network layer handles IP delivery; the link layer moves a frame across one local link.
    Do not confuse it with…
    A layer is a role grouping, not a physical box or a protocol.

    Network

    Limited broadcast

    The IPv4 destination 255.255.255.255, used to reach the local link before a host has normal IP configuration.

    Formal meaning, example & common confusion
    Formal definition
    An IPv4 local broadcast address whose scope is the directly connected network and which routers do not forward.
    Example
    A new DHCP client can broadcast a request to 255.255.255.255.
    Do not confuse it with…
    It is not the all-ones suffix address for one specific subnet; that is a directed broadcast.

    Network

    Link-state (LS) routing

    A routing approach where routers learn network link information and compute paths from a shared map.

    Formal meaning, example & common confusion
    Formal definition
    A class of routing algorithms in which nodes distribute link-state information and calculate least-cost paths, commonly using Dijkstra's algorithm.
    Example
    A router builds a topology map and runs Dijkstra to find a low-cost route to each destination.
    Do not confuse it with…
    Link-state routers share link information; distance-vector routers exchange distance estimates with neighbors.

    Data link

    MAC address

    A link-layer address used to deliver a frame on a local link.

    Formal meaning, example & common confusion
    Formal definition
    A Media Access Control address identifies a network interface for data-link delivery within the scope of a link technology.
    Example
    A host sends a frame to its router's MAC address when the final IP destination is outside the local subnet.
    Do not confuse it with…
    MAC addresses are used on a local link and can change at each routed hop; IP addresses identify the network-layer source and destination across the path.

    Data link

    MAC table

    A switch's learned list of MAC addresses and the ports where those addresses were seen.

    Formal meaning, example & common confusion
    Formal definition
    A bridge or switch forwarding database mapping link-layer addresses to switch ports.
    Example
    After seeing a frame from MAC A on port 2, a switch records that location in its MAC table.
    Do not confuse it with…
    A MAC table maps local frame destinations to ports; a router forwarding table maps IP prefixes to next hops.

    Application

    Message

    Application data ready to be sent using network services.

    Formal meaning, example & common confusion
    Formal definition
    An application-layer unit exchanged by application protocols.
    Example
    An HTTP request asking a web server for a page is an application message.
    Do not confuse it with…
    A message may be split across multiple transport units; it is not automatically one packet.

    Data link

    MTU

    The largest IP packet that can fit in one link frame without extra handling.

    Formal meaning, example & common confusion
    Formal definition
    Maximum Transmission Unit: the maximum packet size supported by a link-layer technology or path segment.
    Example
    If an IP datagram exceeds a link's MTU, it may need fragmentation or another size adjustment, depending on IP version and settings.
    Do not confuse it with…
    MTU is a size limit in bytes, not a transmission speed.

    Across layers

    Multicast

    Communication from one sender to a selected group of receivers.

    Formal meaning, example & common confusion
    Formal definition
    One-to-many group delivery using an address that identifies a multicast group.
    Example
    A network video stream may be sent to a multicast group rather than separately to every receiver.
    Do not confuse it with…
    Multicast is group delivery, while broadcast targets all nodes in a defined scope.

    Network

    NAT

    A router function that rewrites IP address information as packets pass between networks.

    Formal meaning, example & common confusion
    Formal definition
    Network Address Translation maps addresses, often between private internal addresses and a public address, by changing packet headers.
    Example
    A home router can translate several household devices' private addresses to an ISP-facing address.
    Do not confuse it with…
    NAT changes address information; it is not the same thing as routing, even though it is commonly done by a router.

    Network

    Network address

    The first address in a conventional subnet block, with all suffix bits set to zero.

    Formal meaning, example & common confusion
    Formal definition
    An address identifying an IP subnet, calculated by ANDing an address with its subnet mask.
    Example
    The network address for 192.168.1.77/26 is 192.168.1.64.
    Do not confuse it with…
    It identifies the block; it is usually not assigned as an ordinary interface address.

    Network

    Network layer

    The layer that addresses and moves packets across multiple interconnected networks.

    Formal meaning, example & common confusion
    Formal definition
    The layer responsible for logical addressing, routing, and forwarding of datagrams, primarily through IP in the Internet.
    Example
    A router reads the destination IP address and chooses a next hop.
    Do not confuse it with…
    Network layer delivery can cross many links; data-link delivery is for the current link.

    Network

    Network prefix

    The leading bits of an IP address that identify its network block.

    Formal meaning, example & common confusion
    Formal definition
    The fixed-length most-significant portion of an IP address specified by a prefix length or mask.
    Example
    In 192.168.1.10/24, the first 24 bits form the prefix.
    Do not confuse it with…
    The prefix length is a count of bits, not a count of decimal address fields.

    Network

    Next hop

    The next router or local destination to receive a packet along its route.

    Formal meaning, example & common confusion
    Formal definition
    The immediate forwarding neighbor selected for a packet toward its destination.
    Example
    A router may send a datagram to an ISP router as the next hop.
    Do not confuse it with…
    A next hop is one step in a path; it is not the final destination address.

    Data link

    NIC

    A network interface card or adapter that connects a device to a network medium.

    Formal meaning, example & common confusion
    Formal definition
    A Network Interface Controller implements functions for attaching a host or router to a link, including physical and link-layer operations.
    Example
    A laptop's Wi-Fi NIC sends and receives radio frames.
    Do not confuse it with…
    A NIC is hardware or a logical adapter; its MAC address and the interface's IP address belong to different layers.

    Across layers

    OSI model

    A seven-layer reference model used to organize and discuss communication functions.

    Formal meaning, example & common confusion
    Formal definition
    The Open Systems Interconnection model separates communication into physical, data-link, network, transport, session, presentation, and application layers.
    Example
    Ethernet is commonly associated with data-link functions; IP with network-layer functions.
    Do not confuse it with…
    OSI is a model for reasoning, not one protocol stack that every Internet application must implement exactly.

    Network

    PAT

    A form of address translation that lets many inside connections share one outside IP address using transport port numbers.

    Formal meaning, example & common confusion
    Formal definition
    Port Address Translation maps address-and-port combinations to distinguish concurrent flows through a translated address.
    Example
    A home router can map two devices' separate TCP connections to one public IP using different source ports.
    Do not confuse it with…
    PAT uses logical transport port numbers, not physical ports on the router.

    Across layers

    Payload

    The data carried inside a protocol unit, excluding that unit's own control fields.

    Formal meaning, example & common confusion
    Formal definition
    The encapsulated content delivered to a protocol by the layer above it.
    Example
    For an IP datagram, the transport segment is the payload.
    Do not confuse it with…
    The same bytes can be called payload at one layer and a complete unit at the layer that created them.

    Physical

    Physical layer

    The layer concerned with sending encoded bits as electrical, radio, or optical signals over a medium.

    Formal meaning, example & common confusion
    Formal definition
    The lowest communication layer defining signal representation, timing, connectors, frequencies, and transmission media.
    Example
    A fiber transceiver turns bits into pulses of light.
    Do not confuse it with…
    The physical layer carries signals; it does not interpret IP addresses or choose routes.

    Network

    Poisoned reverse

    A distance-vector technique that tells a neighbor a route through that neighbor is unreachable, helping prevent some routing loops.

    Formal meaning, example & common confusion
    Formal definition
    A loop-mitigation rule in which a router advertises an infinite metric for a destination back to the neighbor from which that route was learned.
    Example
    If B reaches X through A, B advertises X as unreachable to A.
    Do not confuse it with…
    Poisoned reverse can prevent two-node loops, but it does not solve every possible routing loop.

    Transport

    Port number

    A number that helps the transport layer deliver data to the right application process on a device.

    Formal meaning, example & common confusion
    Formal definition
    A transport-layer endpoint identifier used with an IP address to demultiplex traffic to a process or service.
    Example
    A client sends a DNS query to the server's UDP port 53.
    Do not confuse it with…
    A port number is a logical software endpoint, not a physical socket or cable connector.

    Across layers

    Protocol

    Shared rules that let networked systems exchange information in a particular way.

    Formal meaning, example & common confusion
    Formal definition
    A specification of message formats, meaning, ordering, and actions taken when messages are sent or received.
    Example
    TCP defines how endpoints establish a connection and deliver an ordered byte stream.
    Do not confuse it with…
    A protocol is the rule set; a layer is where a responsibility is grouped, and a service is what a layer offers upward.

    Across layers

    Protocol data unit (PDU)

    The name for the complete unit a layer sends, including its data and control fields.

    Formal meaning, example & common confusion
    Formal definition
    A layer-specific unit consisting of protocol control information and payload.
    Example
    A TCP segment is the transport-layer PDU; an IP datagram is the network-layer PDU.
    Do not confuse it with…
    PDU is a general term; names such as segment, datagram, and frame identify particular layers' units.

    Transport

    Reliable delivery

    A service that detects missing data and retries or otherwise ensures the receiver gets an ordered stream or confirmed data.

    Formal meaning, example & common confusion
    Formal definition
    A transport property implemented through mechanisms such as acknowledgments, sequence numbers, retransmission, and duplicate suppression.
    Example
    TCP retransmits data when acknowledgments indicate that bytes did not arrive.
    Do not confuse it with…
    Reliable transport does not mean the IP network never loses packets; it means the endpoints handle loss for the application.

    Physical

    Repeater

    A physical-layer device that regenerates a signal so it can travel farther or more reliably.

    Formal meaning, example & common confusion
    Formal definition
    A device that receives and retransmits a signal without interpreting link or network addresses.
    Example
    A repeater restores a weakened bit signal on a long cable run.
    Do not confuse it with…
    A repeater does not choose a route or filter frames by MAC address.

    Network

    Router

    A device that connects IP networks and forwards datagrams toward their destinations.

    Formal meaning, example & common confusion
    Formal definition
    A network-layer packet switch that selects an outgoing interface and next hop using forwarding state.
    Example
    A home router forwards traffic between the household subnet and the ISP network.
    Do not confuse it with…
    A router has multiple interfaces, usually in different subnets; it is not one endpoint with one address.

    Network

    Routing

    The process of determining paths through a network and deciding which directions destinations should use.

    Formal meaning, example & common confusion
    Formal definition
    The control-plane computation and distribution of reachability or path information used to construct forwarding state.
    Example
    Routers run a routing protocol to learn which next hop reaches a remote network.
    Do not confuse it with…
    Routing plans paths; forwarding applies the resulting choice packet by packet.

    Network

    SDN

    Software-defined networking separates network-wide control decisions from packet forwarding devices.

    Formal meaning, example & common confusion
    Formal definition
    An architecture in which control-plane logic can be logically centralized while data-plane devices execute installed forwarding rules.
    Example
    A controller computes routes and installs forwarding entries in switches or routers.
    Do not confuse it with…
    Logically centralized control can still be implemented across multiple machines; it does not mean one physical controller must do everything.

    Across layers

    Service

    A useful capability one layer offers to the layer above it.

    Formal meaning, example & common confusion
    Formal definition
    An abstraction describing operations and guarantees available at a layer boundary, independent of the internal implementation.
    Example
    Transport offers applications ways to exchange data between process endpoints.
    Do not confuse it with…
    Service describes what is offered; protocol describes rules used between peer systems.

    Physical

    Signal

    A physical change, such as voltage, radio energy, or light, used to carry bits.

    Formal meaning, example & common confusion
    Formal definition
    A measurable physical waveform or state that encodes information over a communication medium.
    Example
    A Wi-Fi radio signal carries encoded bit patterns through the air.
    Do not confuse it with…
    The signal is not itself a packet or an address; higher layers give the transmitted bits structure.

    Transport

    Socket

    A software endpoint an application uses to send or receive network data.

    Formal meaning, example & common confusion
    Formal definition
    An operating-system programming abstraction associated with a transport protocol and local/remote endpoint identifiers.
    Example
    A web server listens on a socket associated with its IP address and port 443.
    Do not confuse it with…
    A network socket is software; it is not a physical wall socket, cable jack, or router port.

    Network

    Subnet

    A group of interfaces that share an IP prefix and can communicate over the same local network segment.

    Formal meaning, example & common confusion
    Formal definition
    An IP network segment whose interfaces share a subnet prefix; routers connect distinct subnets.
    Example
    Several computers and one router interface can share 192.168.1.0/24.
    Do not confuse it with…
    A subnet is a network segment or address block, not necessarily an entire building or one device.

    Network

    Subnet mask

    A 32-bit IPv4 value with 1s for prefix bits and 0s for suffix bits.

    Formal meaning, example & common confusion
    Formal definition
    A bit mask that identifies the network prefix in an IPv4 address; /24 corresponds to 255.255.255.0.
    Example
    ANDing 192.168.1.77 with 255.255.255.192 gives network address 192.168.1.64.
    Do not confuse it with…
    A mask marks the boundary; it is not itself an IP address assigned to a host.

    Data link

    Switch

    A LAN device that learns link addresses and sends frames toward the appropriate local port.

    Formal meaning, example & common confusion
    Formal definition
    A link-layer switch forwards frames based on destination MAC addresses and a learned forwarding table.
    Example
    A switch forwards a frame from one office computer's port toward another computer's port.
    Do not confuse it with…
    A typical LAN switch forwards frames within a link network; a router forwards IP datagrams between networks.

    Transport

    TCP

    A transport protocol that provides applications with a reliable, ordered byte stream between endpoints.

    Formal meaning, example & common confusion
    Formal definition
    The Transmission Control Protocol is connection-oriented and uses acknowledgments, sequence numbers, and retransmissions to provide reliable ordered delivery.
    Example
    A web application using HTTP/1.1 can use TCP to deliver its bytes in order.
    Do not confuse it with…
    TCP reliability applies between endpoints; it does not mean every packet always arrives or that the network layer itself is reliable.

    Transport

    TCP segment

    A TCP transport unit containing application bytes and TCP control fields.

    Formal meaning, example & common confusion
    Formal definition
    A transport-layer PDU with a TCP header and a portion of the connection's byte stream.
    Example
    A TCP segment carries source and destination port numbers plus sequence information.
    Do not confuse it with…
    A segment is carried inside an IP datagram; it is not the same thing as an Ethernet frame.

    Across layers

    TCP/IP model

    The layered architecture associated with the Internet protocol suite.

    Formal meaning, example & common confusion
    Formal definition
    A practical model commonly grouping Internet protocols into application, transport, network, link, and physical functions, though diagrams vary in grouping.
    Example
    HTTP, TCP, IP, and Ethernet illustrate protocols at different levels of an Internet stack.
    Do not confuse it with…
    TCP/IP names a protocol suite and model; TCP itself is only one transport protocol within it.

    Across layers

    TLS

    A security protocol that can encrypt a connection and help verify who the peer is.

    Formal meaning, example & common confusion
    Formal definition
    Transport Layer Security protects application communication with encryption, integrity checks, and authentication mechanisms, typically used above a transport such as TCP.
    Example
    HTTPS commonly uses HTTP over TLS over TCP; HTTP/3 instead runs over QUIC, which uses UDP.
    Do not confuse it with…
    TLS is not the same as TCP reliability, and HTTPS layering depends on the HTTP version.

    Across layers

    Trailer

    Control information placed after carried data, often by a link protocol.

    Formal meaning, example & common confusion
    Formal definition
    A protocol-specific field sequence appended to a protocol data unit.
    Example
    An Ethernet frame ends with a frame check sequence trailer.
    Do not confuse it with…
    Not every layer or protocol has a trailer.

    Transport

    Transport layer

    The layer that carries data between application processes on end devices.

    Formal meaning, example & common confusion
    Formal definition
    The end-to-end layer providing process-to-process communication services, including TCP and UDP.
    Example
    A port number lets a host deliver an arriving segment to the right application process.
    Do not confuse it with…
    Transport uses ports; network-layer IP addresses get packets between interfaces and networks.

    Network

    TTL

    A field that limits how many router hops an IPv4 packet can take before being discarded.

    Formal meaning, example & common confusion
    Formal definition
    Time To Live is decremented by routers; in practice it bounds packet lifetime by hop count and prevents indefinite looping.
    Example
    Traceroute uses changing TTL values to reveal successive routers on a path.
    Do not confuse it with…
    TTL is not a precise wall-clock timer in normal forwarding; think hop limit.

    Transport

    UDP

    A lightweight transport protocol that sends individual datagrams without setting up a TCP-style connection.

    Formal meaning, example & common confusion
    Formal definition
    The User Datagram Protocol provides best-effort message delivery with port-based process addressing and minimal transport control.
    Example
    A DNS lookup may use UDP for a short query and response.
    Do not confuse it with…
    Connectionless does not mean addressless: UDP still uses IP addresses and port numbers.

    Transport

    UDP datagram

    A short transport unit sent by UDP with source and destination ports and application data.

    Formal meaning, example & common confusion
    Formal definition
    A UDP message with a header and payload, delivered without TCP's connection setup or ordered-reliability service.
    Example
    A DNS query commonly travels in a UDP datagram.
    Do not confuse it with…
    UDP datagram and IP datagram are different units at different layers.

    Across layers

    Unicast

    Communication from one sender to one intended receiver.

    Formal meaning, example & common confusion
    Formal definition
    One-to-one delivery using a destination address identifying a single endpoint or interface.
    Example
    A browser sends a request to one web server using unicast IP delivery.
    Do not confuse it with…
    Unicast describes delivery pattern, not a particular protocol or layer.

    Data link

    Wi-Fi

    A family of wireless LAN technologies that connects nearby devices using radio.

    Formal meaning, example & common confusion
    Formal definition
    Wi-Fi is based on IEEE 802.11 standards, including physical radio and data-link functions.
    Example
    A phone joins a Wi-Fi access point and sends local link frames over radio.
    Do not confuse it with…
    Wi-Fi is not the Internet itself; it is one possible local link carrying IP traffic.