Course: Internet Architecture and Technologies
Authors: Alessio Sacco, Claudio Casetti, Guido Marchetto, Marco Rapelli.
Source: IPv4 addressing and routing, local 1.pdf, PDF pages 1-18.
Lecture date: not supplied. Numbering follows the filename, not an explicit slide number.

Lecture summary

How can a host send a packet beyond its own network? Begin with what IP provides, then build the address and routing decisions needed to make that delivery possible.

IP carries data in separate packets called datagrams. Each router forwards a packet toward its destination using its routing table, without first setting up an IP connection. This is a best-effort service: packets can be lost, delayed or reordered, and IP itself does not repair those outcomes. That is the basic delivery model on which the rest of the course builds. IPv4 Datagram Service and Forwarding

To forward a packet, the network needs to identify where it is going. An IPv4 address identifies a network interface, so a router connecting several networks normally has an address on each relevant interface. Some addresses have special meanings: loopback refers back to the local host, while broadcast addresses target a set of interfaces rather than one ordinary host. IPv4 Interfaces and Special Addresses

An address alone still leaves a question: which part identifies the network, and which part identifies an interface within it? Historically, address classes imposed fixed boundaries such as /8, /16 and /24. This explains the older terminology, but those classes are not the rule to use for modern route selection. Classful IPv4 Addressing

CIDR makes that boundary explicit with a prefix length. In 192.0.2.10/24, the first 24 bits identify the network; the subnet mask expresses the same division in another form. This lets us describe networks of different sizes instead of being restricted to the old classes. CIDR Prefixes and Netmasks

Once the boundary is known, we can derive the actual network address by setting every host bit to zero. This matters because an address inside a subnet is not necessarily its Network ID: 192.0.2.24/28 belongs to the network starting at 192.0.2.16. Checking boundaries prevents us from building an addressing plan around a subnet that does not start where we think it does. IPv4 Network IDs and Subnet Boundaries

The same prefix also tells us how many addresses fit inside the subnet. Under ordinary IPv4 subnet rules, the network and broadcast addresses are reserved, leaving the remaining addresses for interfaces. Point-to-point /31 links are a special case, while a /32 describes one address. These distinctions matter when choosing a prefix for a real requirement. IPv4 Host Counts and Point-to-Point Subnets

With addresses and subnet boundaries established, a host must decide how to reach a destination. Its routing table contains destination prefixes and instructions for reaching them. If several routes match, the longest prefix wins because it describes the most specific destination range. A default route is the least specific fallback. IPv4 Routing Tables and Longest Prefix Matching

As networks grow, keeping a separate route for every small subnet becomes cumbersome. Aggregation replaces several prefixes with a broader summary, but that summary can also attract packets for unused space. If neighboring routers send such a packet back to each other, a routing loop forms until TTL expires. A summary therefore needs deliberate handling of the space it covers. IPv4 Route Aggregation and Routing Loops

The important connection is that an address identifies the destination, a prefix describes its network, and a route selects the next step. The worked examples below apply those decisions to specific tables and topologies. Once delivery to one destination makes sense, the next lecture asks how to deliver to a group. Lecture 01f - IPv4 Multicast

Topics

  • IPv4 service model and forwarding
  • Interface addressing, special addresses, and historical classes
  • CIDR masks, host counts, and valid Network IDs
  • Routing tables, next hops, default routes, and longest prefix matching
  • Aggregation, forwarding loops, and route costs

Lecture guide

Service model (pages 3-4)

IP supplies a datagram format, an addressing scheme, and forwarding rules at the network layer. It is connectionless: sending a datagram requires no connection setup, and routers forward packets independently. Packets in one flow may take different paths or arrive out of order.

Best effort means that IP does not promise delivery, order, throughput, or delay. It does not itself acknowledge or retransmit packets. When reliability is needed, end systems can provide it through a transport protocol such as TCP.

Each router makes a hop-by-hop forwarding decision using the destination address and its table. IPv4 addresses have 32 bits. The TTL limits packet lifetime; the header checksum covers the header rather than the payload. Fragmentation accommodates smaller link MTUs when permitted. ICMP reports errors and supports diagnostics; ARP resolves IPv4 addresses to link-layer addresses on links such as Ethernet.

Study clarification: the slides describe a simple IP forwarding model. Real equipment can also track flows for functions such as NAT or firewalls. IPv4 fragmentation is subject to the Don’t Fragment flag; it is not guaranteed to happen on every MTU mismatch.

Related: IPv4 Datagram Service and Forwarding.

Interfaces and special addresses (pages 5-6)

Forwarding needs a destination identifier. Before choosing routes, establish exactly what an IP address identifies.

An address identifies an interface. A router connecting several networks normally has an address on each relevant interface. In the lecture’s subnet model, interfaces in one IP network share a network prefix and a link-layer network.

Under traditional subnet rules, all-zero host bits identify the network; all-one host bits identify its directed broadcast. 255.255.255.255 is the limited broadcast address. The 127.0.0.0/8 range is loopback, commonly illustrated with 127.0.0.1.

Study clarification: broadcast addresses a group of interfaces on a subnet. It does not replace the individual address needed by a host. A directed broadcast is an address category, not a promise that routers will forward broadcasts to it.

Related: IPv4 Interfaces and Special Addresses.

Historical classes and CIDR (pages 7-10)

An interface address identifies a destination, but we also need to group destinations into networks. The prefix supplies that boundary.

Class A, B, and C historically split addresses at /8, /16, and /24. The first-octet bit patterns determine the class; CIDR instead makes the prefix length explicit.

For 200.23.16.0/23, 23 bits identify the network and 9 remain for addresses inside it. Its mask is 255.255.254.0; its range ends at 200.23.17.255. The whole mask must be consecutive ones followed by consecutive zeros. Choosing individually allowed octet values is not enough: 255.0.255.0 is not a CIDR mask.

The decimal values possible in a mask octet are 0, 128, 192, 224, 240, 248, 252, 254, 255. The page 9 parenthesized values describe the block increment associated with that octet; they are not always the total subnet size. For example, a /23 has two third-octet values and 512 addresses overall.

Pages 9-10 use the traditional reservation of a Network ID and broadcast address. A /30 has four addresses and two usable hosts. A /31 has only two addresses, leaving no ordinary host addresses under those rules.

Added standards clarification: the slide’s description of /31 as invalid is too broad. RFC 3021 allows both addresses as endpoints of a point-to-point link. A /32 identifies one address, commonly used as a host route; it is not an ordinary multi-host subnet.

Related: Classful IPv4 Addressing, CIDR Prefixes and Netmasks, IPv4 Host Counts and Point-to-Point Subnets.

Valid Network IDs (page 11)

Once the prefix fixes the boundary, we can check whether a written address names the whole subnet or an interface inside it.

A Network ID must have zero in every host bit. For these examples, the boundary is inside the last octet: /30 networks start every 4 addresses, /29 every 8, and /28 every 16.

Slide exampleNetwork ID valid?Explanation
130.192.1.4/30Yes4 is a multiple of 4
130.192.1.16/30Yes16 is a multiple of 4
130.192.1.16/29Yes16 is a multiple of 8
130.192.1.1/30NoNetwork starts at 130.192.1.0
130.192.1.4/29NoNetwork starts at 130.192.1.0
130.192.1.24/28NoNetwork starts at 130.192.1.16

An invalid Network ID can still be a valid host address. For example, .24/28 belongs to the .16/28 subnet and does not name its starting address.

Related: IPv4 Network IDs and Subnet Boundaries.

Networks connected by a router (page 12)

Subnet boundaries tell a host which destinations are local. Reaching a different subnet requires an intermediate router.

The diagram contains three /24 networks: 223.1.1.0/24, 223.1.2.0/24, and 223.1.3.0/24. A router joins them through separate interfaces. The address belongs to the interface on a particular network, not to the router as one indivisible object.

Longest prefix, direct routes, and next hops (pages 13-14)

A router connects networks, but it still needs a rule for choosing the outgoing link for each destination. That rule is longest prefix matching.

The selected route is the most specific matching destination prefix. Page 14 sends 200.23.19.7 toward the /23 route because it matches both 200.23.16.0/20 and 200.23.18.0/23. The /23 covers third octets 18-19, while the /20 covers 16-31.

The outgoing interface is IF2; the next hop is R2’s adjacent interface, 200.24.7.2. That next hop is the immediate neighbor, not the packet’s final IP destination. A direct route instead sends traffic on the attached link without an intermediate router. The router-to-router link 200.24.7.0/30 has usable addresses .1 and .2.

Related: IPv4 Routing Tables and Longest Prefix Matching.

Default route (page 15)

Specific routes cover known destinations. A default route answers the remaining question: where should otherwise unmatched packets go?

0.0.0.0/0 matches every destination and loses to any longer matching prefix. It directs otherwise unmatched traffic to R2.

The /23 exception must remain. Removing it would send 200.23.19.7 through the /20 route on IF1; the default cannot override that /20. A default route is a fallback, not a replacement for every specific entry.

Aggregation and the direct-delivery problem (page 16)

Prefixes can summarize many destinations in one route. That saves entries, but the summary must not promise a usable path into unreachable space.

The larger /20 block is an aggregate of addresses that can be routed internally. It does not imply that every address in the block is on one local link. The expanded topology has R0 serving .16.0/24 and .17.0/24, R2 serving .18.0/23, and R1 joining the routers.

R1 sends the /20 toward R0 at 200.24.6.2, except for the more-specific /23 toward R2 at 200.24.7.2. R0’s default points back toward R1 at 200.24.6.1.

Worked interpretation of the slide’s final question: for destination 200.23.20.7, R1 matches the /20 and sends to R0. R0 has no specific route for it, so its default sends back to R1. The packet loops until TTL expires. The same problem affects other unused parts of the aggregate in this table.

Study clarification: an intentional discard route for unused aggregate space, or appropriate specific routes for allocated space, can avoid this loop. This is an explanation of the example, not a configuration exercise supplied by the slides.

Related: IPv4 Route Aggregation and Routing Loops.

Weighted topology and R1’s table (pages 17-18)

The R1-R2 and R2-R3 links have weight 1 each; R1-R3 has weight 5. Therefore R1 can reach R3’s 130.192.1.0/24 LAN through R2 with cost 2, rather than use the direct router link with cost 5.

Selected entries in the supplied table illustrate the distinction:

DestinationTypeAddress shownCostMeaning
130.192.0.0/24S130.192.3.21Remote next hop: R2
130.192.1.0/24S130.192.3.22R3’s LAN reached through R2
130.192.3.8/30S130.192.3.21Remote transit subnet reached through R2
0.0.0.0/0S80.105.10.21Upstream next hop
130.192.2.0/24C130.192.2.10Local interface on R1’s LAN
130.192.3.0/30C130.192.3.10Local interface toward R2
130.192.3.4/30C130.192.3.50Local interface toward R3
80.105.10.0/30C80.105.10.10Local interface toward upstream

Here S denotes static and C connected. The slide’s Next-hop column shows local interface addresses for C entries; these must not be mistaken for remote routers. Connected routes have cost zero in this teaching table. Route cost does not allow /0 to beat a matching /24: first identify the longest matching prefix.

Worked revision exercises

These are added study exercises, not a supplied exercise sheet.

  1. For 130.192.1.24/28, find network, broadcast, and usable hosts. Answer: network .16, broadcast .31, hosts .17-.30, 14 usable.
  2. For 130.192.1.4/30, identify both hosts. Answer: .5 and .6; .4 is the network and .7 broadcast.
  3. For 200.23.19.7 in page 14, choose /20 or /23. Answer: /23, IF2, next hop 200.24.7.2.
  4. Remove the /23 from page 15. Does the default still reach that branch? Answer: no; the matching /20 wins.
  5. Trace 200.23.20.7 in page 16. Answer: R1 -> R0 -> R1 repeatedly, until TTL expires.
  6. Why does page 18 send traffic for R3’s LAN to R2? Answer: the two weight-1 links cost 2, less than the weight-5 link.

Questions to check understanding

  • What does IP guarantee about a packet?
  • Why does a router have multiple interface addresses?
  • Why can .4 be a Network ID with /30 but a host with /29?
  • Why is a /31 usable on a point-to-point link?
  • Why does a default route lose to an aggregate route?
  • How can aggregation and a default route create a loop?
  • Which addresses in the final table are local and which are remote?

Source and attribution

Alessio Sacco, Claudio Casetti, Guido Marchetto, Marco Rapelli, IPv4 addressing and routing, local 1.pdf. Page references use the complete 18-page PDF’s order. Page 1 also lists Tecnologie e Servizi di Rete and Computer Network Technologies and Services alongside this course title. Page 2 contains the copyright notice; the original PDF remains local and is not redistributed here.

These notes paraphrase the teaching content. Worked calculations, cautions, the page 16 loop trace, and standards clarifications are added study explanations.