SlideShare uma empresa Scribd logo
1 de 16
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)

Mais conteúdo relacionado

Mais procurados

Razin Kabir (063452556)
Razin Kabir (063452556)Razin Kabir (063452556)
Razin Kabir (063452556)
mashiur
 
Lecture1, TCP/IP
Lecture1, TCP/IPLecture1, TCP/IP
Lecture1, TCP/IP
csyuhk
 
Internet control message protocol
Internet control message protocolInternet control message protocol
Internet control message protocol
asimnawaz54
 
CS 6390 Project design report
CS 6390 Project design reportCS 6390 Project design report
CS 6390 Project design report
Abhishek Datta
 
CS 6390 Project design report
CS 6390 Project design reportCS 6390 Project design report
CS 6390 Project design report
Raj Gupta
 
Leonardo Nve Egea - Playing in a Satellite Environment 1.2
Leonardo Nve Egea - Playing in a Satellite Environment 1.2Leonardo Nve Egea - Playing in a Satellite Environment 1.2
Leonardo Nve Egea - Playing in a Satellite Environment 1.2
Jim Geovedi
 

Mais procurados (20)

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

Destaque (6)

Pcm pulse codemodulation-2
Pcm pulse codemodulation-2Pcm pulse codemodulation-2
Pcm pulse codemodulation-2
 
4.osi model
4.osi model4.osi model
4.osi model
 
1 multiplexing
1 multiplexing1 multiplexing
1 multiplexing
 
Rip ospf and bgp
Rip ospf and bgpRip ospf and bgp
Rip ospf and bgp
 
Implementation of FSM Based Automatic Dispense Machine with Expiry Date Feat...
Implementation of FSM Based Automatic Dispense Machine with  Expiry Date Feat...Implementation of FSM Based Automatic Dispense Machine with  Expiry Date Feat...
Implementation of FSM Based Automatic Dispense Machine with Expiry Date Feat...
 
RIP - Routing Information Protocol
RIP - Routing Information ProtocolRIP - Routing Information Protocol
RIP - Routing Information Protocol
 

Semelhante a Tcp ip

Multipath TCP
Multipath TCPMultipath TCP
Multipath TCP
Olivier Bonaventure
 

Semelhante a Tcp ip (20)

Your app lives on the network - networking for web developers
Your app lives on the network - networking for web developersYour app lives on the network - networking for web developers
Your app lives on the network - networking for web developers
 
Introduction to TCP/IP
Introduction to TCP/IPIntroduction to TCP/IP
Introduction to TCP/IP
 
CCNA Interview.pdf
CCNA Interview.pdfCCNA Interview.pdf
CCNA Interview.pdf
 
Multipath TCP
Multipath TCPMultipath TCP
Multipath TCP
 
Clase 1 Direccionamiento IPv4.pdf
Clase 1 Direccionamiento IPv4.pdfClase 1 Direccionamiento IPv4.pdf
Clase 1 Direccionamiento IPv4.pdf
 
Tcp
TcpTcp
Tcp
 
TCP Model
TCP ModelTCP Model
TCP Model
 
Lecture 5 internet-protocol_assignments
Lecture 5 internet-protocol_assignmentsLecture 5 internet-protocol_assignments
Lecture 5 internet-protocol_assignments
 
TCP/IP – Transmission Control Protocol/ Internet Protocol
TCP/IP – Transmission Control Protocol/ Internet ProtocolTCP/IP – Transmission Control Protocol/ Internet Protocol
TCP/IP – Transmission Control Protocol/ Internet Protocol
 
Polyraptor
PolyraptorPolyraptor
Polyraptor
 
Networking Fundamentals: Transport Protocols (TCP and UDP)
Networking Fundamentals: Transport Protocols (TCP and UDP)Networking Fundamentals: Transport Protocols (TCP and UDP)
Networking Fundamentals: Transport Protocols (TCP and UDP)
 
Internet Protocol
Internet ProtocolInternet Protocol
Internet Protocol
 
Internetworking
InternetworkingInternetworking
Internetworking
 
Networking interview questions
Networking interview questionsNetworking interview questions
Networking interview questions
 
TCP/IP Basics
TCP/IP BasicsTCP/IP Basics
TCP/IP Basics
 
Efficient Telecommunication Infrastructure with Internet Telephony (VoIP)
Efficient Telecommunication Infrastructure with Internet Telephony (VoIP)Efficient Telecommunication Infrastructure with Internet Telephony (VoIP)
Efficient Telecommunication Infrastructure with Internet Telephony (VoIP)
 
QSpiders - Upper layer-protocols
QSpiders - Upper layer-protocolsQSpiders - Upper layer-protocols
QSpiders - Upper layer-protocols
 
Clase 4. Routing IP.pdf
Clase 4. Routing IP.pdfClase 4. Routing IP.pdf
Clase 4. Routing IP.pdf
 
Chapter4 Network
Chapter4 NetworkChapter4 Network
Chapter4 Network
 
lecture-2-tcp-ip.ppt
lecture-2-tcp-ip.pptlecture-2-tcp-ip.ppt
lecture-2-tcp-ip.ppt
 

Mais de Akshay Nagpurkar (20)

L6 mecse ncc
L6 mecse nccL6 mecse ncc
L6 mecse ncc
 
1 ip address
1 ip address1 ip address
1 ip address
 
1.network topology
1.network topology1.network topology
1.network topology
 
1.lan man wan
1.lan man wan1.lan man wan
1.lan man wan
 
Dcunit4 transmission media
Dcunit4 transmission mediaDcunit4 transmission media
Dcunit4 transmission media
 
Ppl for students unit 4 and 5
Ppl for students unit 4 and 5Ppl for students unit 4 and 5
Ppl for students unit 4 and 5
 
Ppl for students unit 1,2 and 3
Ppl for students unit 1,2 and 3Ppl for students unit 1,2 and 3
Ppl for students unit 1,2 and 3
 
Ppl for students unit 4 and 5
Ppl for students unit 4 and 5Ppl for students unit 4 and 5
Ppl for students unit 4 and 5
 
234 rb trees2x2
234 rb trees2x2234 rb trees2x2
234 rb trees2x2
 
Ppl home assignment_unit4
Ppl home assignment_unit4Ppl home assignment_unit4
Ppl home assignment_unit4
 
Ppl home assignment_unit5
Ppl home assignment_unit5Ppl home assignment_unit5
Ppl home assignment_unit5
 
3 multiplexing-wdm
3 multiplexing-wdm3 multiplexing-wdm
3 multiplexing-wdm
 
2 multiplexing
2 multiplexing2 multiplexing
2 multiplexing
 
Modulation techniq of modem
Modulation techniq of modemModulation techniq of modem
Modulation techniq of modem
 
Ppl home assignment_unit3
Ppl home assignment_unit3Ppl home assignment_unit3
Ppl home assignment_unit3
 
Ppl home assignment_unit2
Ppl home assignment_unit2Ppl home assignment_unit2
Ppl home assignment_unit2
 
Ppl home assignment_unit1
Ppl home assignment_unit1Ppl home assignment_unit1
Ppl home assignment_unit1
 
Ppl syllabus new
Ppl syllabus newPpl syllabus new
Ppl syllabus new
 
Ppl for students unit 1,2 and 3
Ppl for students unit 1,2 and 3Ppl for students unit 1,2 and 3
Ppl for students unit 1,2 and 3
 
Pentium
PentiumPentium
Pentium
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 

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)

Notas do Editor

  1. Connection connection must be established before data is transferred Reliable Data guaranteed to eventually arrive with no errors