Basic Needs for TCP/IP Communication

Some of the applications we use require us to move data from point a to point b across a network. The TCP/IP network provides a framework for transmitting this data, and it requires some basic information from us to move this data.

We need to specify if we want the most reliable or fastest transmissions, and we need to specify where we want the data delivered. Sometimes our data is routed based on its IP addresses and sometimes its routed based on its MAC address. The data we send needs both addressing capabilities. This information needs to be sent along with all transmitted data. We also need to physically transmit the data from one location to another.

TCP/IP Five Layer Software Model Overview

We need to provide this basic information needed by TCP/IP in a standard format the network can understand. This format is provided by its 5 layer software model.

Each layer provides TCP/IP with the basic information it needs to move our data across the network. These layers group functions according to the task that needs to be performed. Every function in this model is targeted to help a specific layer perform its job.

Each layer only communicates with adjacent layers. Software running in a higher layer does not have to know about or perform tasks delegated to lower layer functions and vise versa. For example, the software you write for your application only needs to know how to request a connection with a remote host using the Transport layer. It doesn’t need to know how bits are encoded before transmission. That’s the Physical layer’s job.

​

You have probably all heard of the 7 layer OSI model. TCP/IP simplifies this model to 5 layers. OSI stands for Open Systems Interconnect which is a standard communication systems model. The top 4 layers of the 7 layer OSI model have been condensed into the top two TCP/IP layers.

TCP/IP Five Layer Model Summary

Before we discuss each layer, let’s briefly summarize what each layer does.

As you might have guessed, the Application layer is where applications requiring network communications live. Examples of these applications include email clients and web browsers. These applications use the Transport Layer to send requests to connect to remote hosts.

The Transport layer establishes the connection between applications running on different hosts. It uses TCP for reliable connections and UDP for fast connections. It keeps track of the processes running in the applications above it by assigning port numbers to them and uses the Network layer to access the TCP/IP network.

The Network layer is responsible for creating the packets that move across the network. It uses IP addresses to identify the packet’s source and destination.

The Physical layer encodes and decodes the bits found in a frame and includes the transceiver that drives and receives the signals on the network.

Transmit Data Using Network Layers

Now that we know the primary job of each layer, let’s see how they work together to send and receive data across a TCP/IP network.

This is a simplified view of how the network layers work together to generate frames. Higher layers pass information to lower layers. Each layer adds information called a header to the data being passed to it. This header contains information the layer needs to perform its job. We will start at the Application Layer.

The Application layer generates a Message. In this case the specific application is a web browser requesting a web page download. This message is then sent to the Transport Layer.

The Transport layer adds the TCP or UDP header which includes the source and destination port addresses. Additional information like the packet sequence number used for TCP will also be added to the header. The data generated by the transport layer is referred to as a Segment if TCP is used, and is referred to as a Datagram if UDP is used. This segment is then sent to the Network Layer.

The Network layer adds a header including the source and destination IP address to generate a packet. This packet is then sent to the Data Link Layer.

The Data Link layer adds a header containing the MAC address information to create a frame. The frame is then sent it to the Physical Layer to transmit the bits.

TCP/IP Five Layer Software Model Terminology Reference

Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.

Click here to edit contents of this page.

Click here to toggle editing of individual sections of the page (if possible). Watch headings for an "edit" link when available.

Append content without editing the whole page source.

Check out how this page has evolved in the past.

If you want to discuss contents of this page - this is the easiest way to do it.

View and manage file attachments for this page.

A few useful tools to manage this Site.

See pages that link to and include this page.

Change the name (also URL address, possibly the category) of the page.