Kahibaro
Discord Login Register

4.2 Internet Layer

Role of the Internet Layer

The Internet layer in the TCP/IP model is responsible for moving data across multiple networks to reach the correct destination network and host. It focuses on logical addressing and routing between networks, not on how bits travel on a cable or how applications see data.

At this layer, data is carried in structures usually called packets. The most common Internet layer protocol today is IPv4, with IPv6 as its successor. The Internet layer sits above the link layer (where Ethernet, Wi-Fi, and similar technologies live) and below the transport layer (where TCP and UDP live).

The main goals of the Internet layer are to provide logical addressing, define packet formats, and enable forwarding and routing through many intermediate devices so that two hosts on different networks can communicate as if they were directly connected.

Key Responsibilities

The Internet layer has several specific jobs that are distinct from the layers above and below.

It must provide logical addressing so every host can be identified on a global scale. In practice this means IP addresses. The Internet layer defines the structure of these addresses and how they are used to select the correct destination network.

It must define the packet format. A packet at the Internet layer consists of an Internet layer header plus the data from the transport layer. The header contains fields such as source IP, destination IP, and other control information. The exact format differs between IPv4 and IPv6, but the general idea is the same.

It must perform routing and forwarding. Routing is the process of deciding which path through the network a packet should follow. Forwarding is the act of taking a packet that has arrived on one interface of a router and sending it out through another interface toward its destination. The Internet layer protocols provide the addressing and basic mechanisms that routing protocols (covered elsewhere) use to build and use routing tables.

It may handle fragmentation and reassembly in IPv4. If a packet is too large for a particular link, IPv4 can split it into fragments so it can traverse that link. This behavior and its details are part of the Internet layer for IPv4. IPv6 handles fragmentation differently.

It must support basic error and control signaling. While ICMP is sometimes described as a separate protocol, it runs alongside IP at the Internet layer and is used for messages such as “destination unreachable” or “time exceeded.” Tools like ping and traceroute rely on this.

Internet Layer vs Other Layers

It is useful to see how the Internet layer is different from the layers above and below without re-explaining those layers fully.

The Internet layer is independent of the underlying physical and link technologies. Ethernet, Wi-Fi, fiber links, and many others can all carry IP packets. Routers use IP information to move packets from one link type to another. The Internet layer does not care if bits travel over copper, radio, or fiber, only that IP packets can be carried.

The Internet layer is also independent of the application details. It does not know about web pages, emails, or file transfers. It only sees packets with a source IP and a destination IP and a transport layer payload. Whether that payload is TCP, UDP, or something else is treated generically.

Compared to the transport layer, the Internet layer does not provide connection management or reliability. It is sometimes described as a “best effort” layer. It will try to deliver packets but offers no guarantee of delivery, ordering, or protection against duplication. Those features, when present, come from higher layers.

Compared to the link layer, the Internet layer addresses devices globally using IP addresses, not just locally on a single network segment. A link layer address such as a MAC address identifies a device on one particular link. An IP address identifies a device in a way that can be used across many interconnected networks.

Core Protocols at the Internet Layer

Several protocols live at the Internet layer or very close to it. The most visible are IPv4 and IPv6, but they are not alone.

IPv4 is the dominant legacy Internet layer protocol. It uses 32 bit addresses and a header that supports options, fragmentation, and a checksum of the header. It is the format most people think of when they imagine an IP address such as 192.168.1.10. Its packet structure, addressing rules, and limitations are covered in detail elsewhere, so here the important point is that IPv4 defines how an Internet layer packet is built and routed in IPv4 networks.

IPv6 is the successor protocol designed to overcome IPv4 address exhaustion and to improve certain aspects of the Internet layer. It uses 128 bit addresses and a simpler base header without a header checksum. Many functions that were optional or complex in IPv4 are redesigned in IPv6. Again, the details belong to separate chapters. At the Internet layer level, IPv6 fills the same role as IPv4 but with a different format and much larger address space.

ICMP, Internet Control Message Protocol, works alongside IP at the Internet layer. It is used by routers and hosts to send error reports and operational information. Examples include messages indicating that a destination is unreachable or that a packet’s time to live has expired. Ping and traceroute rely on ICMP messages.

Other control protocols that are closely tied to the Internet layer include IGMP for IPv4 multicast membership and, in IPv6, Neighbor Discovery for functions that replace some roles of ARP and parts of ICMPv4. Their deep explanations are given elsewhere, but you should recognize that they operate at or very near the Internet layer.

A helpful way to visualize these protocols in this layer is in a simple table.

ProtocolMain Role at Internet Layer
IPv4Packet format and addressing (32 bit)
IPv6Packet format and addressing (128 bit)
ICMPv4Error and control for IPv4
ICMPv6Error and control for IPv6
IGMPIPv4 multicast group management

Logical Addressing and Packet Delivery

At the Internet layer, every packet carries a source IP address and a destination IP address. These addresses identify where the packet is coming from and where it needs to go at the logical, network wide level.

Each IP address belongs to a network. Routers examine the destination IP address and consult their routing tables to decide which next hop or interface to use. The Internet layer does not figure out how to reach the final host in one step. Instead, it selects one step at a time, forwarding the packet closer to its target network.

The process of moving a packet through multiple routers is sometimes called a hop by hop forwarding model. At each hop a router takes four basic actions. It receives the packet on an interface. It examines the destination IP in the header. It looks up the best matching route. It forwards the packet out of the selected interface toward the next hop. This continues until a router has a route that points directly to the destination network, which leads to the final delivery.

The Internet layer also includes a basic loop protection mechanism using a field called the time to live in IPv4 or hop limit in IPv6. This value is stored in the packet header and is decreased by 1 at each hop. If the value reaches 0, the router discards the packet and typically sends an ICMP “time exceeded” message back. This prevents a packet from circulating forever if there is a routing loop.

Important: At the Internet layer, packet delivery is best effort. The network tries to deliver packets, but it does not guarantee delivery, order, or protection from duplication. Higher layers must handle reliability if it is required.

Fragmentation and Path Constraints

One specific technical behavior that belongs to the Internet layer is fragmentation in IPv4. Each link in a path has a maximum transmission unit, or MTU, which is the largest packet size that can be carried on that link. If a router receives a packet that is larger than the outgoing interface MTU, IPv4 may split the packet into fragments so that each fragment fits on the link. Each fragment carries a copy of the Internet layer header with additional information that allows the destination host to reassemble the original packet.

IPv6 treats fragmentation differently and encourages the use of a technique called path MTU discovery so that end hosts adjust the size of packets before sending them, instead of having routers fragment them. The existence and handling of fragmentation, and the associated MTU and path issues, are results of Internet layer design.

From the perspective of the Internet layer, fragmentation is a trade off between flexibility and complexity. It allows packets that are larger than some links to be carried across the path, but it can add overhead and increase the chance of loss if any fragment is dropped.

Encapsulation at the Internet Layer

Within the TCP/IP model, the Internet layer receives data from the transport layer and hands data down to the link layer. Although encapsulation in general is covered in separate chapters, the specific role of the Internet layer in this process is important.

When a transport layer segment is ready to be sent, the Internet layer wraps it in an IP packet. The transport layer data becomes the payload. The Internet layer creates an IP header that includes source and destination IP addresses, the protocol field that indicates the transport protocol (such as TCP or UDP), and other control data. The result is an IP packet.

This packet is then given to the link layer. The link layer encapsulates it again in a frame suitable for the local network technology. Across a multi hop path, the IP header usually stays the same, while link layer headers are changed at each hop as the packet moves from one physical network to another.

At the receiving host, the process is reversed. The link layer removes the local frame header and trailer and passes the IP packet up to the Internet layer. The Internet layer checks the header, verifies that the packet is addressed to the local host, and then hands the transport layer payload up to the correct transport protocol based on the protocol field.

Key rule: At the Internet layer, the IP header + transport layer data form an IP packet. The IP header carries logical addressing and control, and the payload carries transport and application data.

Practical View of the Internet Layer

In real networks, the Internet layer is where most of the addressing and reachability decisions happen. When you configure an IP address on a device, assign a default gateway, or plan an addressing scheme, you are working directly with Internet layer concepts.

When a device knows only its local network and a default gateway, it sends all non local traffic to that gateway. The Internet layer then depends on routers along the way, each with their own routes, to move packets toward their destinations. Routing protocols and static routes, which populate these routing tables, operate around Internet layer information.

Diagnostic tools also largely target Internet layer behavior. When you run ping, you test whether IP packets can reach another host and come back. When you run traceroute, you see which routers at the Internet layer are forwarding your packets. When you receive a message that a destination network is unreachable, that information is conveyed using Internet layer control protocols.

As more advanced features such as NAT, VPNs, and policy based routing are introduced in other sections of the course, you can think of them as specific ways to transform or guide Internet layer packets. They all rely on the basic Internet layer concepts of IP addressing, packet structure, and hop by hop routing decisions.

Views: 41

Comments

Please login to add a comment.

Don't have an account? Register now!