SlideShare a Scribd company logo
5
Most read
10
Most read
16
Most read
1




Introduction to TCP/IP
2
       OSI and Protocol Stack                             OSI: Open Systems Interconnect



        OSI Model             TCP/IP Hierarchy               Protocols

           7th
    Application Layer

           6th
    Presentation Layer       Application Layer

           5th
      Session Layer

           4th
                              Transport Layer
     Transport Layer

          3rd
                              Network Layer
     Network Layer

            2nd
        Link Layer
                                Link Layer
            1st
      Physical Layer


Link Layer             : includes device driver and network interface card
Network Layer          : handles the movement of packets, i.e. Routing
Transport Layer        : provides a reliable flow of data between two hosts
Application Layer      : handles the details of the particular application
3
      Packet Encapsulation
๏ฎ The data is sent down the protocol stack
๏ฎ Each layer adds to the data by prepending headers




                 22Bytes 20Bytes 20Bytes            4Bytes

                                 64 to 1500 Bytes
4
       Ethernet

   ๏ฎ   Computer <-> Computer communication on
       same network
   ๏ฎ   Each device has unique MAC address (48-bit)
       example: 00-C0-4F-48-47-93


Ethernet Packet:
 Preamble    Dest.    Source    Type         Data         CRC
            address   address

  8bytes    6bytes     6bytes   2bytes   64 - 1500bytes    4bytes


                                                    MAC: Media Access Control
5
     ARP : Address Resolution Protocol
๏ฎ   ARP provides mapping
    32bit IP address <-> 48bit MAC address
    128.97.89.153 <-> 00-C0-4F-48-47-93
๏ฎ   ARP cache
    maintains the recent mappings from IP addresses to MAC addresses


Protocol
4.  ARP request broadcast on Ethernet
5.  Destination host ARP layer responds
6
       IP: Internet Protocol
  ๏ฎ   Unreliable โ€ฆ connectionless datagram delivery service
  ๏ฎ   Responsible for routing of data through intermediate
      networks and computers


                              11   1111   1111   2222   2222   2233
IP header:    0123   4567   8901   2345   6789   0123   4567   8901



 1 :ICMP
 6 :TCP
 17 :UDP
7
    IP Routing
       Source                            Destination
     Application                         Application
      Transport         Router           Transport
      Network          Network            Network
        Link             Link               Link




๏ฎ   Routing Table
       Destination IP address
       IP address of a next-hop router
       Flags
       Network interface specification
8
       ICMP : Internet Control Message Protocol
๏ฎ   Used to report problems with delivery of IP Datagrams
    within an IP network
๏ฎ   Used by Ping, Tracerout commands
                                               ICMP Message
                                         20bytes   4bytes


                                            IP     ICMP     ICMP
                                          Header   Header    Data

Types and Codes
๏ฎ Echo Request (type=8, code=0)         Type  Code Checksum

๏ฎ Echo Reply(type=0, code=0)           1byte  1byte  2bytes

๏ฎ Destination Unreachable(type=3, code=0)

๏ฎ Time Exceeded(type=11, code=0) : Time-to-Live =0
9
        TCP : Transmission Control Protocol
๏ฎ           Connection-Oriented, Reliable, Byte Stream Service
Protocol
3.   Set up connection
4.   Transfer data
5.   Close connection

    TCP Header Format
    0   1   2    3   4   5   6   7   8    9    1    1   1   1     1      1     1   1   1   1   2   2    2    2   2   2   2   2   2   2   3   3
                                               0    1   2   3     4      5     6   7   8   9   0   1    2    3   4   5   6   7   8   9   0   1
                             Source Port                                                           Destination Port
                                                            Sequence Number
                                                        Acknowledgement Number
                     -   -   -   -
        Data                                                                                                Window
        Offset
                                     ย  ย  ย  ย  ย  ย  ย  ย 
                             Checksumย ย 
                                  ย ย            ย ย    ย ย   ย ย  ย ย       ย ย     ย ย                             Urgent Pointer
                                     ย ย    ย ย    ย ย    ย ย   ย ย  ย ย       ย ย     ย ย 
                                     ย ย    ย ย    ย ย 
                                      ย     ย     ย 
                                                    Optionsย ย (0
                                                    ย ย 
                                                     ย 
                                                        ย ย 
                                                         ย   ย 
                                                                   ย ย 
                                                                  toย 
                                                                         ย ย 
                                                                        10ย 
                                                                              Words of 32 Bits)
                                                                TCP Payload
ย 
10
TCP : State Diagram
11
              TCP : Connection


     Client             Host                     Client              Host

Send SYN seq=x                              Send FIN seq=x
                   Receive SYN segment                         Receive FIN segment
                   Send SYN seq=y,                             Send ACK x+1
                                         Receive ACK segment
Receive SYN        ACK x+1
+ACK segment                                                   Send FIN seq=y,
                                             Receive FIN       ACK x+1
                                             + ACK segment
Send ACK y+1
                                             Send ACK y+1
                   Receive ACK segment                         Receive ACK segment




    Establishing a TCP Connection              Closing a TCP Connection
12
        TCP : Data transfer

                  Client                           Host

            Send Packet 1
            Start Timer        Packet Lost   Packet should arrive
Timer                                        ACK should be sent
         ACK would normally
         Arrive at this time


             Time Expires

          Retransmit Packet1
Timer     Start Timer                        Receive Packet 1
                                             Send AXK 1
            Receive ACK 1
            Cancel Timer
13
    HTTP : Hyper Text Transfer Protocol

๏ฎ   Stateless Transaction Protocol
    Each transaction creates a new connection
Steps in Transaction
4.  Establish connection
5.  Request
      Method <URL> <CR>
7.  Response
      Response Code <Data> <CR>
9.  Close connection
14
    HTTP

๏ฎ   Common Request Methods
    GET, PUT, POST
๏ฎ   Response Categories
    Informational       :100
    Successful          :200
    Redirection         :300
    Client Error        :400 (eg. 404 Not found)
    Server Error        :500
15
       Example: Access www.ee.ucla.edu

Client                                                                 Server
            Http request
Appl        GET โ€œhttp://www.ee.ucla.eduโ€<CR>                          Appl
            Http response
   HTTP     200 โ€œโ€ <CR> <html file in MIME format>                       HTTP
Transp                     Initiate connection (hdshk)                Transp
            Package data (add TCP header)
            send http request packet
   TCP                                          Assemble response        TCP
                                       (break into several packets)
                                       Send http response packets
                            Close connection (hdshk)
           send data to next hop
Net                                          Net                      Net
                                Relay data
   IP      ARP to provide                       IP                       IP
           IP/MAC translation
Link                                         Link                     Link
ethernet                                     ethernet                 ethernet
                                             Router(s)
16
     References
๏ฎ   โ€œTCP/IP Illustrated, Volume 1 The Protocols โ€œ
    by W. Richard Stevens (http://yenigul.net/tcpip)

๏ฎ   โ€œInternet Working with TCP/IP Volume 1โ€
    by Douglas E. Comer

๏ฎ   โ€œSams Teach Yourself TCP/IP in 24 Hoursโ€
    by Joe Casad. Published by Sams. (
    http://www.informit.com)

More Related Content

PPT
Np unit1
PDF
WIRELESS NETWORK
PPT
Np unit iv ii
PPT
Computer network (Lecture 2)
PPT
Tcp Ip Overview
PPT
Bluetooth mobileip
PPT
Tcp ip
PDF
Ipv6 cheat sheet
Np unit1
WIRELESS NETWORK
Np unit iv ii
Computer network (Lecture 2)
Tcp Ip Overview
Bluetooth mobileip
Tcp ip
Ipv6 cheat sheet

What's hot (20)

PPT
Mobile IP
PDF
Razin Kabir (063452556)
ย 
PPT
Lecture1, TCP/IP
ย 
PPTX
IPv6 - Neighbour Discovery
ย 
PDF
Ipv6 cheat sheet
PDF
Network and DNS Vulnerabilities
PDF
Osi model
PPT
IPv6_Quick_Start_Guide
PPT
Internet control message protocol
PPT
Ports & sockets
PDF
An Efficient Black Hole Attack Securing Mechanism in Ad Hoc On Demand Distanc...
PDF
RARP, BOOTP, DHCP and PXE Protocols
PDF
Ix1000 Pro-MPEG/SMPTE 2022 FEC Inserter MPEG over IP
ย 
PPTX
Normas y Estรกndares
PDF
Lec 12(Transport Layer)
PDF
CS 6390 Project design report
PDF
CS 6390 Project design report
PPTX
Part 12 : Local Area Networks
PPT
Day-3 PowerPoint
PDF
Leonardo Nve Egea - Playing in a Satellite Environment 1.2
Mobile IP
Razin Kabir (063452556)
ย 
Lecture1, TCP/IP
ย 
IPv6 - Neighbour Discovery
ย 
Ipv6 cheat sheet
Network and DNS Vulnerabilities
Osi model
IPv6_Quick_Start_Guide
Internet control message protocol
Ports & sockets
An Efficient Black Hole Attack Securing Mechanism in Ad Hoc On Demand Distanc...
RARP, BOOTP, DHCP and PXE Protocols
Ix1000 Pro-MPEG/SMPTE 2022 FEC Inserter MPEG over IP
ย 
Normas y Estรกndares
Lec 12(Transport Layer)
CS 6390 Project design report
CS 6390 Project design report
Part 12 : Local Area Networks
Day-3 PowerPoint
Leonardo Nve Egea - Playing in a Satellite Environment 1.2
Ad

Viewers also liked (6)

PPT
Pcm pulse codemodulation-2
PPT
4.osi model
PPT
1 multiplexing
PPT
Rip ospf and bgp
PDF
Implementation of FSM Based Automatic Dispense Machine with Expiry Date Feat...
ย 
PPSX
RIP - Routing Information Protocol
Pcm pulse codemodulation-2
4.osi model
1 multiplexing
Rip ospf and bgp
Implementation of FSM Based Automatic Dispense Machine with Expiry Date Feat...
ย 
RIP - Routing Information Protocol
Ad

Similar to Tcp ip (20)

ODP
Your app lives on the network - networking for web developers
PPT
Introduction to TCP/IP
PDF
CCNA Interview.pdf
PPTX
Multipath TCP
PDF
Clase 1 Direccionamiento IPv4.pdf
PPT
Tcp
ย 
PPT
TCP Model
PPT
Lecture 5 internet-protocol_assignments
PDF
TCP/IP โ€“ Transmission Control Protocol/ Internet Protocol
PPTX
Polyraptor
PDF
Networking Fundamentals: Transport Protocols (TCP and UDP)
PPT
Internet Protocol
PPTX
Internetworking
DOCX
Networking interview questions
PPT
TCP/IP Basics
PDF
Efficient Telecommunication Infrastructure with Internet Telephony (VoIP)
PPS
QSpiders - Upper layer-protocols
PDF
OSI Model, Ports, and Protocols Cheat Sheet.pdf
PDF
OSI MODEL, PORTS, AND PROTOCOLS CHEAT SHEET
PDF
Clase 4. Routing IP.pdf
Your app lives on the network - networking for web developers
Introduction to TCP/IP
CCNA Interview.pdf
Multipath TCP
Clase 1 Direccionamiento IPv4.pdf
Tcp
ย 
TCP Model
Lecture 5 internet-protocol_assignments
TCP/IP โ€“ Transmission Control Protocol/ Internet Protocol
Polyraptor
Networking Fundamentals: Transport Protocols (TCP and UDP)
Internet Protocol
Internetworking
Networking interview questions
TCP/IP Basics
Efficient Telecommunication Infrastructure with Internet Telephony (VoIP)
QSpiders - Upper layer-protocols
OSI Model, Ports, and Protocols Cheat Sheet.pdf
OSI MODEL, PORTS, AND PROTOCOLS CHEAT SHEET
Clase 4. Routing IP.pdf

More from Akshay Nagpurkar (20)

PPT
L6 mecse ncc
PPT
1 ip address
PPT
1.network topology
PPT
1.lan man wan
PPT
Dcunit4 transmission media
PDF
Ppl for students unit 4 and 5
PDF
Ppl for students unit 1,2 and 3
PDF
Ppl for students unit 4 and 5
PDF
234 rb trees2x2
DOCX
Ppl home assignment_unit4
DOCX
Ppl home assignment_unit5
PPT
3 multiplexing-wdm
PPT
2 multiplexing
PPTX
Modulation techniq of modem
DOCX
Ppl home assignment_unit3
DOCX
Ppl home assignment_unit2
DOCX
Ppl home assignment_unit1
DOCX
Ppl syllabus new
PDF
Ppl for students unit 1,2 and 3
PPT
Pentium
L6 mecse ncc
1 ip address
1.network topology
1.lan man wan
Dcunit4 transmission media
Ppl for students unit 4 and 5
Ppl for students unit 1,2 and 3
Ppl for students unit 4 and 5
234 rb trees2x2
Ppl home assignment_unit4
Ppl home assignment_unit5
3 multiplexing-wdm
2 multiplexing
Modulation techniq of modem
Ppl home assignment_unit3
Ppl home assignment_unit2
Ppl home assignment_unit1
Ppl syllabus new
Ppl for students unit 1,2 and 3
Pentium

Recently uploaded (20)

PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
ย 
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
ย 
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
The Rise and Fall of 3GPP โ€“ Time for a Sabbatical?
ย 
PPTX
Big Data Technologies - Introduction.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Empathic Computing: Creating Shared Understanding
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Electronic commerce courselecture one. Pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Spectral efficient network and resource selection model in 5G networks
Dropbox Q2 2025 Financial Results & Investor Presentation
ย 
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
ย 
Understanding_Digital_Forensics_Presentation.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
The Rise and Fall of 3GPP โ€“ Time for a Sabbatical?
ย 
Big Data Technologies - Introduction.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Network Security Unit 5.pdf for BCA BBA.
Encapsulation_ Review paper, used for researhc scholars
Programs and apps: productivity, graphics, security and other tools
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Empathic Computing: Creating Shared Understanding
MYSQL Presentation for SQL database connectivity
Electronic commerce courselecture one. Pdf
Unlocking AI with Model Context Protocol (MCP)
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Building Integrated photovoltaic BIPV_UPV.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton

Tcp ip

  • 2. 2 OSI and Protocol Stack OSI: Open Systems Interconnect OSI Model TCP/IP Hierarchy Protocols 7th Application Layer 6th Presentation Layer Application Layer 5th Session Layer 4th Transport Layer Transport Layer 3rd Network Layer Network Layer 2nd Link Layer Link Layer 1st Physical Layer Link Layer : includes device driver and network interface card Network Layer : handles the movement of packets, i.e. Routing Transport Layer : provides a reliable flow of data between two hosts Application Layer : handles the details of the particular application
  • 3. 3 Packet Encapsulation ๏ฎ The data is sent down the protocol stack ๏ฎ Each layer adds to the data by prepending headers 22Bytes 20Bytes 20Bytes 4Bytes 64 to 1500 Bytes
  • 4. 4 Ethernet ๏ฎ Computer <-> Computer communication on same network ๏ฎ Each device has unique MAC address (48-bit) example: 00-C0-4F-48-47-93 Ethernet Packet: Preamble Dest. Source Type Data CRC address address 8bytes 6bytes 6bytes 2bytes 64 - 1500bytes 4bytes MAC: Media Access Control
  • 5. 5 ARP : Address Resolution Protocol ๏ฎ ARP provides mapping 32bit IP address <-> 48bit MAC address 128.97.89.153 <-> 00-C0-4F-48-47-93 ๏ฎ ARP cache maintains the recent mappings from IP addresses to MAC addresses Protocol 4. ARP request broadcast on Ethernet 5. Destination host ARP layer responds
  • 6. 6 IP: Internet Protocol ๏ฎ Unreliable โ€ฆ connectionless datagram delivery service ๏ฎ Responsible for routing of data through intermediate networks and computers 11 1111 1111 2222 2222 2233 IP header: 0123 4567 8901 2345 6789 0123 4567 8901 1 :ICMP 6 :TCP 17 :UDP
  • 7. 7 IP Routing Source Destination Application Application Transport Router Transport Network Network Network Link Link Link ๏ฎ Routing Table Destination IP address IP address of a next-hop router Flags Network interface specification
  • 8. 8 ICMP : Internet Control Message Protocol ๏ฎ Used to report problems with delivery of IP Datagrams within an IP network ๏ฎ Used by Ping, Tracerout commands ICMP Message 20bytes 4bytes IP ICMP ICMP Header Header Data Types and Codes ๏ฎ Echo Request (type=8, code=0) Type Code Checksum ๏ฎ Echo Reply(type=0, code=0) 1byte 1byte 2bytes ๏ฎ Destination Unreachable(type=3, code=0) ๏ฎ Time Exceeded(type=11, code=0) : Time-to-Live =0
  • 9. 9 TCP : Transmission Control Protocol ๏ฎ Connection-Oriented, Reliable, Byte Stream Service Protocol 3. Set up connection 4. Transfer data 5. Close connection TCP Header Format 0 1 2 3 4 5 6 7 8 9 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 Source Port Destination Port Sequence Number Acknowledgement Number - - - - Data Window Offset ย  ย  ย  ย  ย  ย  ย  ย  Checksumย ย  ย ย  ย ย  ย ย  ย ย  ย ย  ย ย  ย ย  Urgent Pointer ย ย  ย ย  ย ย  ย ย  ย ย  ย ย  ย ย  ย ย  ย ย  ย ย  ย ย  ย  ย  ย  Optionsย ย (0 ย ย  ย  ย ย  ย  ย  ย ย  toย  ย ย  10ย  Words of 32 Bits) TCP Payload ย 
  • 10. 10 TCP : State Diagram
  • 11. 11 TCP : Connection Client Host Client Host Send SYN seq=x Send FIN seq=x Receive SYN segment Receive FIN segment Send SYN seq=y, Send ACK x+1 Receive ACK segment Receive SYN ACK x+1 +ACK segment Send FIN seq=y, Receive FIN ACK x+1 + ACK segment Send ACK y+1 Send ACK y+1 Receive ACK segment Receive ACK segment Establishing a TCP Connection Closing a TCP Connection
  • 12. 12 TCP : Data transfer Client Host Send Packet 1 Start Timer Packet Lost Packet should arrive Timer ACK should be sent ACK would normally Arrive at this time Time Expires Retransmit Packet1 Timer Start Timer Receive Packet 1 Send AXK 1 Receive ACK 1 Cancel Timer
  • 13. 13 HTTP : Hyper Text Transfer Protocol ๏ฎ Stateless Transaction Protocol Each transaction creates a new connection Steps in Transaction 4. Establish connection 5. Request Method <URL> <CR> 7. Response Response Code <Data> <CR> 9. Close connection
  • 14. 14 HTTP ๏ฎ Common Request Methods GET, PUT, POST ๏ฎ Response Categories Informational :100 Successful :200 Redirection :300 Client Error :400 (eg. 404 Not found) Server Error :500
  • 15. 15 Example: Access www.ee.ucla.edu Client Server Http request Appl GET โ€œhttp://www.ee.ucla.eduโ€<CR> Appl Http response HTTP 200 โ€œโ€ <CR> <html file in MIME format> HTTP Transp Initiate connection (hdshk) Transp Package data (add TCP header) send http request packet TCP Assemble response TCP (break into several packets) Send http response packets Close connection (hdshk) send data to next hop Net Net Net Relay data IP ARP to provide IP IP IP/MAC translation Link Link Link ethernet ethernet ethernet Router(s)
  • 16. 16 References ๏ฎ โ€œTCP/IP Illustrated, Volume 1 The Protocols โ€œ by W. Richard Stevens (http://yenigul.net/tcpip) ๏ฎ โ€œInternet Working with TCP/IP Volume 1โ€ by Douglas E. Comer ๏ฎ โ€œSams Teach Yourself TCP/IP in 24 Hoursโ€ by Joe Casad. Published by Sams. ( http://www.informit.com)

Editor's Notes

  • #10: Connection connection must be established before data is transferred Reliable Data guaranteed to eventually arrive with no errors