What is Internet TCP/IP Stack?
Credit: NIKKI

What is Internet TCP/IP Stack?

TCP/IP, or Transmission Control Protocol/Internet Protocol, is a set of rules that helps different devices on the internet talk to each other. It was created by the 'Department of Defense (DoD), This is a part of the United States government responsible for military operations' in the 1960s.

TCP is a set of communication protocols that supports network communication.

The TCP model is subdivided into five layers, each containing specific protocols.

Layers of TCP Model

Layers of TCP Model

1. Physical Layer:

The physical layer is the first layer in the network communication model. It is responsible for turning data into signals that can be sent over different types of media (wires, fiber optics, radio waves). This is where actual communication happens between devices.

Signals are generated depending on the type of media used to connect two devices.

Key Points:

1. Translating Message Bits into Signals:

- The physical layer converts data (bits) into signals that can be transmitted. These signals vary based on the medium used.

2. Types of Signals:

- Electrical Signals: Used for copper cables.

- Light Signals: Used for optical fibers.

- Radio Waves: Used for wireless transmission through air or vacuum.

3. Characteristics Specified by the Physical Layer:

Topology: The layout or structure of how devices are connected in the network.

- Bus Topology: All devices are connected to a single central cable. (Think of a single cable running through your house, and all your devices are plugged into this one cable. If the cable breaks, the whole network stops working.)

- Star Topology: All devices are connected to a central hub. (Imagine a central point, like a hub or switch, in the middle of your house, and all your devices are connected to this hub with individual cables. If one cable breaks, only that device is affected.)

- Hybrid Topology: A combination of different topologies. (This is a mix of different topologies. For example, you might have a star layout in one part of your house and a bus layout in another part. It combines the features of multiple layouts.)

- Mesh Topology: Devices are interconnected, creating multiple paths for data. (Picture a web where each device is connected to multiple other devices. This creates many paths for data to travel. If one path fails, there are other paths available, making it very reliable.)

- Ring Topology: Devices are connected in a circular fashion. (Think of a circle where each device is connected to two other devices, forming a ring. Data travels around the circle until it reaches its destination. If one device fails, the whole network can be disrupted, unless there's a way to reroute the data.)

3. Line Configuration:

- Point-to-Point: Direct connection between two devices.

- Multipoint: Multiple devices share the same connection medium.

4. Transmission Mode:

- Simplex: Communication is one-way only.

- Half-Duplex: Communication is two-way, but not at the same time (like a walkie-talkie).

- Full-Duplex: Communication is two-way simultaneously (like a phone call).

In simple terms, the physical layer handles how data is physically sent over different media and defines the structure and form of the network.

2. Data Link Layer (DLL)

The Data Link Layer (DLL) is divided into two parts:

  1. MAC (Media Access Control)
  2. LLC (Logical Link Control)

MAC (Media Access Control)

The MAC layer is responsible for data encapsulation(Framing) of IP packets from the network layer into frames. Framing means DLL adds a header(which contains the MAC address of source and destination) and a trailer(which contains error-checking data) at the beginning and end of IP packets.

  • Encapsulation (Framing): This means wrapping IP packets (chunks of data) in a frame, which is like putting a letter in an envelope.
  • Header: Added to the beginning of the packet. It includes:
  • Source MAC Address: The unique address of the device sending the data.
  • Destination MAC Address: The unique address of the device receiving the data.
  • Trailer: Added to the end of the packet. It includes:
  • Error-Checking Data: Information used to check if the data was received correctly.

LLC (Logical Link Control)

LLC deals with flow control and error control.

  • Flow control: Limits how much data a sender can transfer without overwhelming the receiver.
  • Error Control: Error in the data transmission can be detected by checking the error detection bits in the trailer of the frame.

In Simple Terms, The MAC layer puts data into "envelopes" (frames) with addresses and error-checking info and the LLC layer ensures data is sent at the right speed and checks for errors to ensure accurate communication.

3. Network Layer

The network layer is responsible for handling data transfer between devices across different networks. Here’s how it works:

  1. Adding IP Addresses:

- IP Address (Logical Address): A unique identifier given to each device on a global scale, like a unique mailing address for a house.

- The network layer attaches IP addresses to data segments to form IP packets, which helps in identifying where the data should go.

2. Finding the Best Path:

The network layer determines the best possible path for the data to travel from the sender to the receiver, similar to finding the best route on a map.

Common Protocols in the Network Layer:

  1. IP (Internet Protocol): Uses the receiver's IP address to decide the best route for sending data packets to their destination.

Role:

  • Fragmentation: If a packet is too large to send in one go, IP breaks it into smaller pieces (fragments) for easier transmission. These pieces are put back together at the receiving end.
  • Unreliable: IP does not guarantee delivery or check for errors. It just sends the packets.

2. ARP (Address Resolution Protocol):

Role: Finds the MAC (physical) address associated with a given IP address. Think of it like looking up a person's home address based on their name.

3. ICMP (Internet Control Message Protocol):

Role: Responsible for reporting errors. If something goes wrong in the transmission, ICMP sends messages to report the issue.

In Simple Terms, The network layer adds IP addresses to data, finds the best route for delivery, and uses protocols to manage data transfer and report errors. IP finds the best path and splits data if needed but doesn't ensure delivery. ARP helps find physical addresses using IP addresses. ICMP reports any errors that occur during data transmission.

4. Transport Layer

The transport layer manages the delivery of data between devices, ensuring it arrives correctly and efficiently. It handles flow control (controlling the rate at which data is transferred), end-to-end connectivity, and error-free data transmission.

Key Functions:

  1. Flow Control: Regulates the speed of data transfer so the receiver isn't overwhelmed.
  2. End-to-End Connectivity: Ensures a continuous and direct connection between the sender and receiver.
  3. Error-Free Data Transmission: Detects and corrects errors in data transmission.

Protocols Used in the Transport Layer:

  1. TCP (Transmission Control Protocol):

  • Connection-Oriented: Requires setting up and ending a connection between devices before and after data transfer.
  • Segmentation: Breaks the message into smaller parts (segments), assigns sequence numbers to them, and then reassembles them in the correct order at the receiving end.
  • Reliable: Checks for errors, retransmits lost or damaged data, and ensures data is delivered in the correct order.

2. UDP (User Datagram Protocol):

  • Connectionless: Does not require setting up or ending a connection between devices.
  • No Segmentation: Sends data as is, without breaking it into smaller parts.
  • Less Reliable: Does not check for errors or ensure correct delivery, making it faster and more efficient for applications that can tolerate some data loss (like streaming or gaming).

In Simple Terms, The transport layer makes sure data gets from one device to another correctly and efficiently. TCP is like a careful delivery service that sets up a route, breaks a big package into smaller parts, checks if every part arrives safely, and puts them back together at the destination. UDP is like a quick delivery service that sends packages without setting up a route or checking if they all arrive, making it faster but less reliable.

5. Application Layer

The application layer is the topmost layer in the network model. It combines three layers from the OSI model: session, presentation, and application. This layer allows users to interact with software applications to access network resources.

Key Functions:

  • User Interaction: Enables users to use software applications to access the internet and other network services.
  • Access to Network Resources: Provides protocols that let applications send and receive data over the network.

Protocols Used in the Application Layer:

  1. HTTP (Hypertext Transfer Protocol): Used to access and transfer data on the World Wide Web (web pages, images, etc.).
  2. DNS (Domain Name System): Translates human-readable domain names (like www.google.com) into IP addresses (like 142.250.72.78), which computers use to identify each other on the network.
  3. SMTP (Simple Mail Transfer Protocol): Used to send email messages from one server to another.
  4. FTP (File Transfer Protocol): Used to transfer files between computers over a network.
  5. TELNET (Telecommunication Network): A two-way communication protocol that allows a user on one computer to log into another computer remotely.

In Simple Terms, The application layer is where you, the user, interact with network services through applications like web browsers, email clients, and file transfer tools.

  • HTTP: Lets you view websites.
  • DNS: Converts website names into the numerical IP addresses that computers use.
  • SMTP: Sends your emails.
  • FTP: Transfers files between computers.
  • TELNET: Allows you to connect and control another computer from a distance.


Subscribe to this newsletter, and start your journey to learn system design in this easy-peasy way. See you in next article. Till then, Good bye.

Follow Nikki M. here.



Anuj Yadav

Senior Consultant- Cyber security

8 个月

Useful tips

回复
sundus saqer

assistant marketing coordinator

8 个月

Hi, I'd really appreciate it if you could share or donate to this GoFundMe campaign.*Together to build our future again: Supporting our project* Read more here https://gofund.me/e9224cda Forward this message to your contacts to help this campaign reach its target! instagram for more details: sundusaqer

回复
Saloky Kumar

Network Engineer

8 个月

Thanks for sharing

要查看或添加评论,请登录

Nikki M.的更多文章

社区洞察

其他会员也浏览了