networking
  • networking
  • 1.NetworksAndTheirBasicComponents
    • Overview of Networks
    • Network Components
    • Network Resources
    • Network Geography
    • Wired Network Topology
    • Wireless Network Topology
    • Internet of Things(IoT)
  • 2.NetworkModels
    • Frames
    • MAC(Media Access Control) Address
    • Broadcast vs Unicast
    • Hubs vs. Switches
    • Introduction to IP Addressing
    • Packets and Ports
    • What is
    • OSI Model vs. TCP/IP Model
    • OSI and TCP/IP Model Walkthroughs
  • blogs
    • Layer 7 Proxy
    • Proxy vs Reverse Proxy
    • Service Proxy
Powered by GitBook
On this page
  1. 2.NetworkModels

OSI and TCP/IP Model Walkthroughs

  • Consider a scenario where a Web Client wants to Communicate with a Web Server over HTTP

  • Let's go over the sequence of all steps:

  • Following will cover steps to get data when it receives Ethernet frame from outside.

    • OSI: Physical, TCP/IP: Network Interface(Link)

      • The NIC receives an Ethernet Frame, and the first job is to check if the incoming frame is for himself.

    • OSI: Data Link, TCP/IP: Network Interface(Link)

      • Next thing will do the frame check sequence to make sure frame is in good shape and then strip the frame check sequence and MAC addresses and keep those MAC addresses which might be useful to send frame back.

    • Now what we're left with is a IP Packet, which is sent to above layers.

    • OSI: Network, TCP/IP: Internet

      • Network or Internet layer only deals with IP addresses.

      • Again its first job is to check if the IP is for himself. Then it will strip the IP address and store the source IP address for responding in case.

    • Now we're left this what is called a TCP Segment.

    • OSI: Transport, TCP/IP: Transport

      • Assembler or disassembler of data using sequencing number.

      • At the time disassembling it break data into TCP Segment and assign sequence number.

      • At the time of assembling it will combine those TCP Segments back together using sequence number.

    • Now we have the complete data and port number.

    • OSI: Session, Presentation, Application, TCP/IP: Application

      • Session layer: allows Server to connect with client on remote server.

      • Presentation layer: some translation between data to make application understand it.

      • Application layer: Doesn't mean ur actual application like web browser or email client.

        • It's the builtin smarts that allows them to interact with the network. For example the API layer

        • At this layer we are left with port numbers and data.

        • Based on target port it will move that data to that target app. For example if Port 80 then give it to webserver.

        • It will store the return port number in case required to send response back.


  • Now will see steps of how a data is sent out as an Ethernet Frame:

    • OSI: Session, Presentation, Application, TCP/IP: Application

      • Will take data, add the source and target port.

    • OSI: Transport, TCP/IP: Transport

      • If the data is big, it will break the data into small chunks to fit into IP Packet.

      • And combining small data chunk with sequence number and port numbers will make a TCP Segment

    • OSI: Network, TCP/IP: Internet

      • This layer will attach the IP Addresses and will make an IP Packet from the TCP Segment it received from transport layer.

    • OSI: Physical, Data Link TCP/IP: Network Interface(Link)

      • Will add MAC addresses to IP Packet and frame check sequence and make an Ethernet Frame

      • And send it out.

PreviousOSI Model vs. TCP/IP ModelNextblogs

Last updated 2 years ago