Communication protocol – TCP/ IP

Introduction

Internet is a network of networks, connects many LANs and WANs into a single network. It can be understand that Internet is link electronic devices together.

Lots of computers connected together by send and receive electrical signal, so there are rules to help them understand electrical signal mean (eg: what the data, how to encode the data, …). Those rules called network protocol.

There are 2 commons protocol stands: TCP/IP and OSI

TCP/IP is the backbone of internet, the core way of defining what we can communicate. OSI(Open System Interconnection) model is using in teaching. We will compare these two models in another post http://TCP/IP vs OSI. In this post we will focus on TCP/IP suite.

TCP/IP model

    There are 4 layer in TCP/IP model: Network Access (layer 1), Internet (layer 2), Transport (layer 3), Application (Layer 4).

    1. Application layer (layer 4)

    Application layer provides different services including application service protocols (FTP – File Transfer Protocol, HTTP – hypertext transfer protocol, SNMP – Simple Network Management Protocol, DNS – Domain Name System), presentation services (format data, data structure, encoding, …), session services(dialog control, session management, …)

    2. Transport layer (layer 3)

    Transport layer handle process-to-process delivery (end to end). Process-to-process is identified as the interaction from one program in one computer to another program in another computer. Computer can run many programs at once, Transport layer will determine on that device where the info coming from or going to, which program on that device.

    Unit data: segment

    Protocols: TCP (Transmission Control Protocol), UDP (user Datagram Protocol), SCTP (Stream Control Transmission Protocol). http://TCP vs UDP at Transport layer

    3. Internet layer (layer 2)

    Internet layer handles host-to-host delivery using logical addressing. While Transport layer determine which source of info, Internet layer will get information from one device to another device.

    Unit data: packets or datagrams

    Protocol: IP (Internet Protocol), ARP (Address Resolution protocol), RARP (Reverse Address Resolution protocol), ICMP (Internet Control Message protocol), IGMP (Internet Group Management Protocol).

    4. Network Access layer (layer 1)

    Network Access layer refers as host-to-network(node-to-node) layer using physical addressing.

    Unit data: frames

    Local network protocols: Ethenet, Wifi, Point-to-Point protocol

    Use case: A web browser take the request for a web page. The data will be break into small pieces then send as segment in the transport layer. The transport layer uses services of Internet layer to encapsulate the data into internet packet (datagrams or packets) and physically transmit in the host of Network Access layer.

    The interaction between one program from one computer to another program in another computer seems directly but behind the scene, beneath that interaction, the data will moves from layer to layer.

    Application will interact data from applications live above to take the data and encapsulation the data.

    Encapsulation process

    1. Application layer

    The application will wrapping the data with a header

    At this step, the data is an APDU (Application layer Protocol Unit)

    The application layer will pass APDU to Transport layer

    2. Transport layer

    At the transport later, APDU will split into pieces called segments

    TCP header will add into each segment

    TCP header includes sequence number(help put segments together at the destination) and port numbers( the destination)

    PDUs at this layer refers to segments

    Pass segments down to the Internet layer

    3. Internet layer

    The Internet layer add IP header into each TCP segments

    IP header includes logical address of sender and receiver

    PDU at Internet layer refers as datagrams or packets

    Pass packets to Network Access layer

    4. Network Access

    The Network Access layer add header(physical address of source and destination) and trailer(error check sequence) into packets

    PDUs refer as frames

    Encode frames into sequence of bits and transport out of the sender into local physical network

    Decapsulation

    While sender will add headers each layer, the receiver will remove header at appropriate layer. Each layer only understand how to deal with the head information associated with that layer (Ex: the internet layer will not understand frames info)

    Leave a comment