The network layer

Data structures for networking

The IP suite nests data structures. Each nesting is called a layer. Each layer is used to handle a unique and well defined part of the process of transmitting information from sender to receiver. This means that in addition to a formatted structure at each layer, operations for software to process that layer have to be defined.

In the 70's, when the IP was invented, it was thought that five layers could be distinguised. In the 80's, the ISO worked out that seven were required to describe a network completely.

Original five layers

Seven layer model

IPv4 address classes

Initially classes were introduced to assist routing. Today routing has moved to be classless - CIDR and VLSM. However, classes are still used in networking

Class Lower Upper Binary start
A 0.0.0.0 127.255.255.255 0
B 128.0.0.0 191.255.255.255 10
C 192.0.0.0 223.255.255.255 110
D 224.0.0.0 239.255.255.255 1110
E 240.0.0.0 247.255.255.255 1111

Unicast

Unicasting is when one computer talks to another one. EG, a web browser -> server. This is enabled with TCP or UDP at layer 4.

Multicast

Multicasting is when one computer sends the same message to several computers. EG, a stock exchange -> brokers. This is done with UDP multicast.

Broadcast

Broadcasting is a a mechanism of a copmuter sending a message to all computers on its own network.

IPv4 addresses

Private addresses

Certain addresses in the IPv4 protocol are reserved for private use. They should never be routed onto the public Internet.

Class Lower Upper
A 10.0.0.0 10.255.255.255
B 172.16.0.0 172.31.255.255
C 192.168.0.0 192.168.255.255

A private network may be built and then connected to the public Internet using a technique known as Network/Port Address Translation (NAT/PAT).

Loopback

127.0.0.1 is a special IPv4 address. This is the loopback within the computer. IP packets are sent from the Transmit (Tx) to the Receive (Rx) within the same computer. This allows for testing of the software layers but not the physical layers. This is a good way to test a new piece of client/server software without setting up or configuring a network.