大象传媒

Network layering

In networking, means to break up the sending of messages into separate components and activities. Each component handles a different part of the communication. This can be referred to as a stack. The Transmission Control Protocol/Internet Protocol (/) is a protocol stack used when connecting a device to the internet.

There are four layers to be considered:

  • - encodes/decodes the message into a form that is understood by the sender and the recipient devices using protocols like , file transfer protocol () and .
  • - breaks down the message into small pieces called . Each packet is given a packet number and the total number of packets. The recipient uses this information to assemble the packets in the correct order. It also allows the recipient to see if there are any missing packets.
  • - adds the sender鈥檚 and that of the recipient. The then knows where to send the message, and where it came from. This is sometimes called the network layer.
  • - enables the physical transfer of packets between on a network, and between one network and another.
The four network layers are application, transport, internet and link.

Layering enables to be developed, but also to be adapted to new and over time. For example, different software packages (applications) may use the same transport, internet and link layers but may each use their own application layer. The way the program encodes the message changes - the rest of the communication method remains the same.

IP addressing

At the internet layer, the IP - Internet Protocol - part of the TCP/IP protocol stack needs each node to have an IP address assigned to it. This address consists of four sets of up to three digits, each with a maximum value of 255. Each set is separated by dots. An example is:

192.168.0.254

When a node wants to send a message to another node, it uses the recipient node's IP address as the destination.

The method of using four sets of digits held in 32 is called IPv4. When IPv4 was devised, the range of addresses it allowed was deemed to be sufficient. However, the huge increase in internet-enabled devices led to IPv4 running out of addresses. A new version - IPv6 - has been introduced, significantly increasing the number of possible addresses to trillions. IPv6 addresses are held in 128 bits.

Transmissions over a network can be extremely large. To send a large message in one go can be impractical, as both the sending and receiving node are tied up with one communication.

Packet switching

TCP/IP uses to send data across a network. In packet switching, messages are broken up into very small pieces, called packets. Each packet consists of two parts:

  • header - this includes the sender's and recipient's IP addresses, the packet number, the total number of packets the message contains, plus the details of any protocols used
  • - this is part of the message itself

The packets are sent individually across the network and put back together to reform the message at the other end.

Packets may or may not follow the same route - they are sent along whichever route gives the quickest transmission. Therefore, packets may arrive out of sequence.

The recipient takes each packet, makes a note of its number and then puts it into the correct order. A packet switched network can therefore be fault tolerant. If a particular connection fails, the packets can be sent via a different route and then reassembled in the correct order. This is possible even if some packets are delayed.

The principles of packet switching