TCP/IP

connection encapsulation

The TCP/IP Stack

The Transfer Control Protocol/ Internet Protocol are split into four different layers, with the complete model being referred to as the stack. The layers consist of the application, transport, network and link layers. When data needs to be sent, it is passed down the stack from the application layer to the link layer. When data is received, it is passed up the stack from the link layer to the network (also known as the internet) layer, where the data’s destination can be discovered and either further passed up the layers if it has reached its destination or passed down and along to its destination. This is a part of the packet switching method of data transferral, which will be expanded on later.

Layer Function
Application Layer The application layer is responsible for encoding the data that is to be sent. It includes the protocols used for providing services and passing application data along the network. Protocols in this layer include the Hypertext Transfer Protocol (HTTP), the File Transfer Protocol (FTP), the Simple Mail Transfer Protocol (SMTP), etc. These protocols use lower level protocols for data transfer. Many of these protocols have reserved ports for data transfer, such as 80 and 8080 for HTTP.
Transport Layer The transport layer receives the data from the application layer and splits it into separate packets, with an order number and port number. It is also responsible for error control, flow and congestion control.
Network/ Internet Layer The network layer is responsible for attaching the sender and destination IP address. The IP addresses combined with the ports create sender and receiver sockets. It is also responsible for packet routing, forwarding the data packets to the next router towards their destination.
Link Layer The lowest layer in the TCP/IP stack. The link layer is the direct physical link between the networks, and is responsible for data transfer. The link layer adds the MAC address, which identifies the hardware devices the data is being sent to and from.

MAC Addresses

The Media Access Control Address, or MAC address, is a unique identifier for network interfaces. MAC addresses are assigned by the manufacturer of the network interface controllers and are stored in read only memory in the hardware. Network interface cards allow a computer to communicate across a network. They convert the data from a form understood by the sender computer into a form that can be transmitted and received over a network.

IP Addresses

The Internet Protocol (IP) address is a numerical label assigned to a device connected to a network. An IP address allows for identification of the sender of data and acts as a location address for the data to be sent to. IPv4, the most common form of IP address, is a 32 bit numerical identifier. An IPv4 address is split into 4 segments, the first two being the network identifier and the second two being the host identifier.

Packet Switching

Packet switching is a method for communication over a network in which the data being sent is split into smaller pieces, called packets. Each packet is assigned its place in the original data, to allow for reconstruction at the other end, along with the source and destination sockets. Each one is then sent to the destination address via moving through other networks between the source and destination. The route of each packet varies depending on the congestion on each network and available paths. Splitting the data into packets means the data transmission is not as dependent on the availability of the networks on the path. Once the data is received a confirmation message is returned to the sender, and the packets are reordered and the data is retrieved. If no confirmation message is returned then the sender automatically retransmits the data.