ACtE0503 Network layer¶
Core role¶
- Network layer provides logical addressing and routing across multiple networks.
- It chooses paths, forwards packets, and handles fragmentation details in IPv4.
- IP and ICMP are network-layer protocols. The syllabus also lists ARP and RARP in this area, but they operate at the IPv4 network/link boundary for local address resolution rather than as routing protocols.
- RIP, OSPF, and BGP are routing protocols.
IPv4 addressing and classful system¶
An IPv4 address is 32 bits, conventionally written as four 8-bit octets. An IPv6 address is 128 bits.
| Class | First bits | First-octet range | Default network/host split |
|---|---|---|---|
| A | 0 | 1-126 | /8 |
| B | 10 | 128-191 | /16 |
| C | 110 | 192-223 | /24 |
| D | 1110 | 224-239 | Multicast |
| E | 1111 | 240-255 | Experimental |
Notes:
- 127.x.x.x is reserved for loopback.
- 0.0.0.0 is the unspecified address.
- Classful addressing is historically important; modern practice uses CIDR.
Subnetting¶
- Subnetting borrows host bits to create subnet bits.
- Subnet mask marks network-plus-subnet bits with 1 and host bits with 0.
- For a prefix /n, host bits are \(32-n\) in IPv4.
- Number of addresses per subnet is \(2^{h}\) where \(h\) is host bits.
- Usable host addresses per ordinary subnet are usually \(2^{h}-2\) because network and broadcast addresses are reserved.
Quick formulas:
\[
\text{addresses per subnet}=2^h, \qquad
\text{usable hosts}=2^h-2.
\]
One-step example:
- For 192.168.10.0/26, host bits \(=6\), addresses \(=64\), usable hosts \(=62\).
Routing algorithms¶
| Algorithm | Core idea | Typical drawback or cue |
|---|---|---|
| Shortest path | Choose minimum-cost path | Basis of many routing decisions |
| Flooding | Forward on all outgoing links except incoming one | Heavy duplication, good for robustness |
| Distance vector | Exchange distance info with neighbors | Count-to-infinity issue |
| Link state | Each router floods link states and computes shortest paths | More computation and memory |
Recognition cues:
- Distance vector is associated with Bellman-Ford style updates and neighbor knowledge.
- Link state is associated with full topology maps and Dijkstra shortest-path computation.
Routing protocols¶
| Protocol | Type | Main cue |
|---|---|---|
| RIP | Interior gateway, distance vector | Hop-count metric, simple, small networks |
| OSPF | Interior gateway, link state | Cost metric, faster convergence, large enterprise |
| BGP | Exterior gateway, path vector | Inter-domain routing on the Internet |
Do not confuse:
- Routing algorithm is the mathematical or logical method.
- Routing protocol is the implemented set of messages and rules used by routers.
- RIP, OSPF, and BGP are protocols, not just algorithms.
IP, ICMP, ARP, RARP¶
| Protocol | Main job |
|---|---|
| IP | Best-effort packet delivery across networks |
| ICMP | Error reporting and control messages |
| ARP | IPv4-to-MAC mapping on local LAN |
| RARP | MAC-to-IPv4 mapping, mostly obsolete |
ICMP cues:
- Used by ping and traceroute-related diagnostics.
- Carries messages such as destination unreachable and time exceeded.
- It is not a transport protocol and does not replace TCP or UDP.
Unicast and multicast¶
- Unicast: one sender to one receiver.
- Broadcast: one sender to all hosts on a local broadcast domain.
- Multicast: one sender to a selected group.
- IPv4 Class D addresses are multicast.
- IPv6 has multicast but no broadcast; multicast replaces many broadcast-style functions.
Routing distinction:
| Delivery | Routing behavior | Examples or companion protocol |
|---|---|---|
| Unicast | Finds a path to one destination address | RIP, OSPF, BGP carry unicast routes |
| Multicast | Builds a distribution tree toward members of a group | PIM, DVMRP, or MOSPF families |
IGMP for IPv4 and MLD for IPv6 manage host membership in multicast groups; they are not themselves multicast routing protocols. A multicast address identifies a group, whereas a multicast routing protocol determines how group traffic crosses routers.
IPv6 essentials¶
| Item | Key fact |
|---|---|
| Address length | 128 bits |
| Notation | Hexadecimal groups separated by colons |
| Header style | Simpler fixed basic header than IPv4 |
| Extension headers | Optional chained headers for extra functions |
| Broadcast | No broadcast in IPv6 |
| Multicast | Native and important |
Transition ideas:
- Dual stack runs IPv4 and IPv6 together.
- Tunneling carries IPv6 through IPv4 infrastructure.
- Translation mechanisms exist when direct compatibility is impossible.
Packet-format cues¶
- IPv4 header includes fields such as version, IHL, TTL, protocol, source and destination addresses.
- IPv6 header includes version, traffic class, flow label, payload length, next header, hop limit, source and destination addresses.
- TTL in IPv4 and hop limit in IPv6 limit endless circulation.
Network-layer examples¶
- If the protocol is inter-domain Internet routing, choose BGP.
- If the algorithm constructs a full topology map and runs shortest path, think link state and OSPF-style logic.
- If the address block is 224.0.0.0 to 239.255.255.255, it is IPv4 multicast.
ACtE0503 revision box¶
- Network layer = logical addressing + routing.
- RIP: distance vector; OSPF: link state; BGP: inter-domain path vector.
- ARP is local IPv4-to-MAC support, not a transport protocol.
- IPv6 uses 128-bit addresses, extension headers, multicast, and no broadcast.
- Stable subnetting recall: hosts per subnet \(=2^h-2\) for ordinary usable hosts.