Course contents

Unit 3: Network ModelsLesson 3.1.5 (6 of 14 in this unit)18 of 95 in the Network Fundamentals course

OSI Layer 3: Network

The server is on another subnet. How does your packet get there?

Beginner · 6 min read · Before this: The OSI model

Technical definition

The OSI Network layer is layer 3 of the OSI reference model. It provides network addressing, routing and relaying to transfer network-layer protocol data units across interconnected networks.

In plain English: Moves packets between different networks using logical (IP) addresses, choosing a route hop by hop.

What this layer does

IPv4 addresses have 32 bits; IPv6 addresses have 128 bits. A prefix length identifies the network portion: with 192.168.1.20/24, the subnet is 192.168.1.0/24. The address alone does not tell you that subnet.

A router compares the packet's destination address with its routes and normally chooses the matching route with the longest prefix. A route may come from a connected interface, a static setting or a routing protocol. It is not necessarily the path with the fewest routers or the lowest delay.

IP addressing and routing choose where a packet goes next; they do not guarantee that it arrives.

Follow one request from PC-1

PC-1 is a user's computer opening a page on the lab web server. Its IPv4 address is 192.168.1.20/24 and its gateway is R1 at 192.168.1.1. The server is on another subnet, at 203.0.113.20/24, with gateway 203.0.113.1. The /24 means that the first 24 bits identify each subnet. R1 joins the two subnets.

Network: the same request, a different responsibility
Network: the same request, a different responsibilityPC-1 connects over Ethernet to R1 Gi0/0. R1 Gi0/1 connects to the lab server over a second Ethernet link. PC-1 uses 192.168.1.20/24, R1 uses 192.168.1.1/24 and 203.0.113.1/24, and the server uses 203.0.113.20/24. The server listens on TCP port 443.LAN A · 192.168.1.0/24LAN B · 203.0.113.0/24PC-1R1 · routerWeb server192.168.1.20/24203.0.113.20/24Eth0Gi0/0Gi0/1Eth0192.168.1.1/24203.0.113.1/24TCP example: PC-1 source port 51524 → server destination port 443

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Two Ethernet links and one router; addresses are examples and no NAT is used. The server subnet is reserved for documentation.

In this request: Your packet carries source 192.168.1.20 and destination 203.0.113.20, and each router picks the next hop.

The interface labels identify the ends of the cables: Eth0 is the example Ethernet interface on each host, while Gi0/0 and Gi0/1 are R1's two Gigabit Ethernet interfaces. Actual device names vary. An IP address identifies an interface; TCP port 443 identifies the HTTPS service endpoint. It is not a physical socket on the router.

Where it fits in the other model

The four-layer TCP/IP model calls this the Internet layer. Both descriptions help you discuss addressing and forwarding between networks.

The trade-off is between a more detailed vocabulary and a simpler description of deployed protocols. OSI names seven responsibilities; the four-layer TCP/IP model groups some of them together. Neither view requires a separate header for every named responsibility.

When it does not work

A wrong subnet mask can make the host treat a remote address as local. A wrong gateway can stop traffic to other networks while local communication still works. Read the address and prefix together, then check the destination's most specific matching route. The default route is a fallback; a more specific route can take precedence. A routing table entry is evidence of a chosen path, not proof that every device on it forwards successfully.

Try a practical check

Use PowerShell on Windows for this observation exercise. These commands inspect your own connection or request a public example service; they do not configure R1 or contact the documentation server in the figure.

ipconfig route print -4

On Windows, first identify your active interface's IPv4 address, mask and gateway. Then inspect the IPv4 route table. Network Destination and Netmask describe a route's prefix; Gateway and Interface show where it goes next. Your real addresses will differ from this lab. Do not replace working settings with the documentation addresses shown in the diagram.

Your task: identify one useful field in the result, state what it shows, then name something it cannot prove. If the command is unavailable or a request is blocked, record that limitation rather than treating it as proof of a failed layer.

Check your understanding

Predict · scenario 1

A PC has address 192.168.1.20. Can you determine its subnet from that address alone?

Technical references