What is the TCP/IP model and the function of each layer
We learned all about Firewall Security in our previous tutorial. Here, in this tutorial we will learn about TCP/IP Model. Show
The TCP/IP model refers to transmission control protocol and Internet protocol. The current Internet model is using this network model for communication purposes. Read through the Training Tutorials on Networking for clear understanding of the concept. These protocols are simply a combination of the rules which regulate each communication over the network. These, in turn, decide the path to be followed for communication between the source and destination or the internet. The TCP/IP Model consists of four layers which conclude the overall communication process. In this tutorial, we will take an in-depth look at the functionality of each layer. As a software tester, it is necessary to empathize with the TCP/IP model, as the software applications work on the top layer i.e the application layer of this model. What You Will Learn: Network ArchitectureThe four-layer architecture is as follows: Protocols and Networks used in this networking model are shown in the below figure: Let’s summarize the protocols and main uses of each layer in the TCP/IP Model with the help of the below diagram. Functions of Each Layer in TCP/IP ModelEnlisted below are the various functions of each layer in the TCP/IP Model. Network Access LayerFunctions of the Network Access Layer are given below:
Internet Layer
Internet ProtocolThe purpose of this protocol is to route the data packets to the destination as per the information in the packet header by following a set of protocols. By adding a header which has the IP address of the source and destination, the segment received from TCP or UDP is converted into PDU known as a packet. When the packet arrives at the router, it looks at the destination address in the header and then forwards the packet accordingly to the next router to reach the destination. Let’s understand this with an Example: In the below figure, when host A wants to communicate with host B, it will not use any routing protocol as both are in the same network range having the IP addresses of the same set. But if Host A wants to send a packet to Host C then with the help of the protocol it discovers that the destination host is of some another network. Thus the above format will look up into the routing table to find out the next hop address for reaching out to the destination. In this case, host A will reach the host C via router A, B and C. As router C is directly connected to a destination network via a switch, the packet is delivered to Host C. The router gets all the routing related information from the IP header fields. The network layer of TCP/IP (data-link layer) will be responsible for end to end delivery of the data packets. Packet flow in Internet Protocol IPV4 Header
We will discuss this in detail, in our upcoming tutorials. Transport Layer
Port Number: In a network, a host device may send or receive traffic from several sources at the same time. In such a situation, the system will not recognize which of the applications the data belongs to. TCP and UDP protocols resolve these issues by putting a port number in their headers. The well-known application layer protocols are allocated with the port number of the range 1 to 1024. At the source end, every TCP or UDP session is allocated with a random port number. The IP address, port number, and type of protocol used in combination reforms a socket at both the source and destination end. As every socket is exclusive, several hosts can send or receive traffic at the same interval of time. The below table shows the port number that is assigned to several application layer protocols corresponding to the transport layer protocol. Application ProtocolTransport ProtocolPort NumberHTTPTCP80HTTPSTCP443FTP(control)TCP21FTP(data)TCP20SSHTCP22TelnetTCP23DNSTCP, UDP53SMTPTCP25TFTPUDP69 Multiple session using port number TCP
The below figure shows the format of the TCP header.
There are 3 steps of three-way handshaking, which are as follows:
As described in the below figure, in the three-way handshake process, firstly the source host sends a TCP header to the destination host by setting the SYN flag. In response, it gets back the SYN and acknowledgment flag set. The destination host practices the received sequence number plus 1 as the acknowledgment number. TCP IP supports the client-server model of the communication system. Three-Way Handshake Process
TCP Sliding Window and Reliable Delivery User Datagram Protocol (UDP):It is the unreliable and connection-less protocol for data transmission. In this protocol, unlike TCP it doesn’t generate any ACK flag, hence the source host will not wait for a response from the destination end and it will transmit the data without any delay and wait for ACK. In a real-time scenario, UDP is used as the dropping of the data packets is chosen over waiting for packets for re-transmission. Thus it is most widely used in gaming, watching video online, chatting etc where acknowledgment of data is not a concern. In these scenarios, error checking and correction take place at the application layer. UDP header:
UDP Applications:
Application Layer(i) This is the top layer of the TCP/IP model. (ii) It performs all the tasks of a session layer, presentation layer, and application layer of the TCP/IP model. (iii) It combines the functions of interfacing with various applications, data encoding, data translation and provisions access for the users to communicate with various networking systems. The most common application layer protocols are defined below: #1) TELNET: It stands for terminal emulation protocol. It generally practices accessing the remote end applications. The telnet server which acts as the host initiates a telnet server application to establish a connection with the remote end host known as the telnet client. After the connection is established, it is presented to the OS of the telnet server. The people on the server end use its keyboard and mouse to operate and access the far end host through TELNET. #2) HTTP: It stands for hypertext transfer protocol. It is the base of the World Wide Web (WWW). This protocol is used to exchange the hypertext among different systems. It is a type of request-response protocol. For Example, Web browser like internet explorer or Mozilla act as a web client and the application streaming on the PC hosting the website will act as a web server. Thus, the server which provisions the resources like HTML files and other functions requested by the client returns a response message to the client which has the content of the completion status data and requested data in the message line. HTTP resources are recognized and positioned on the network by uniform resource locators (URL’s) deploying uniform resource identifiers (URI) methods HTTP and https. #3) FTP: It stands for file transfer protocol. It is used for sharing or transferring the files among two hosts. The host which runs the FTP application behaves as the FTP server while the other behaves as the FTP client. The client host requesting for file sharing requires for authentication from the server to access the data. Once authorized, it can access any type of files from the server, send or receive files. #4) SMTP: Simple mail transport protocol is an exercise to send e-mails. When we are configuring the host for sending e-mails, we use SMTP. #5) DNS: Each of the host devices in any network has a unique logical address called the IP address. As discussed already the IP addresses are a group of so many numbers and it is not easy to memorize. When we type any web address on a web browser such as Google.com then we are actually requesting for a host having an IP address. But we need not memorize the IP address of the web page that we are requesting for as DNS (domain name server) maps a name against each logical IP address and stores it. Thus when we type in the browser for any web page, then it sends the DNS query to its DNS server to map the IP address against the name. Once it gets the address, an HTTP session is built with the IP address. #6) DHCP: Each of the host devices in any network require an IP address for communication with the other devices in the network. It gets this address by manual configuration or by using a dynamic host configuration protocol (DHCP). If using DHCP, then the host will automatically be assigned with an IP address. Suppose a network is comprising of 10,000 host devices. Then allocating IP address manually to each host is very difficult and is time taking too, thus we use DHCP protocol for assigning an IP address and other information to the connected host devices such as subnet mask IP or gateway IP. Software testing programs will work on this layer of the TCP/IP model, as it provisions the end users to test the various services and use those services. ConclusionWe have seen the different protocols that are used at each layer of the TCP/IP model to perform the tasks associated with the layer and their benefits in a communication system. All the above-defined protocols have their own significance and different roles in testing and applying the software tools. What are the layers of TCP IP model?This figure depicts the layers of the TCP/IP protocol. From the top they are, Application Layer, Transport Layer, Network Layer, Network Interface Layer, and Hardware.
What are the main 5 layers in TCP IP model?The TCP/IP model is based on a five-layer model for networking. From bottom (the link) to top (the user application), these are the physical, data link, net- work, transport, and application layers.
What are the 4 layers of TCP IP?Layers of the TCP/IP Model. Network Access Layer.. Internet Layer.. Host to Host Layer.. Application Layer.. What are the IP model layers and the working of every layer in depths?Network Access Layer
This is the bottom layer of the TCP/IP Model and it includes all the functionality of the physical layer and the data-link layer of the OSI reference model. Thus it characterizes the protocols, hardware, and media to be used for communication.
|