Tcp Udp Icmp And The Transport Layer

Uploaded on

Tcp Udp Icmp And The Transport Layer

Tcp Udp Icmp And The Transport Layer

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads


Total Views
On Slideshare
From Embeds
Number of Embeds



Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

    No notes for slide


  • 1. TCP,UDP, ICMP and the transport layer Lecture February 4,2001 Professor Tom Mavroidis
  • 2. Protocols
    • IP is a connectionless, datagram-oritented, and packet forwarding protocol
    • IP sends a packet based on the destination IP address and routing information held internally within the protocol
    • Packets may pass through several gateways or hops before reaching their destination
  • 3. IP - Internet Protocol
    • Unreliable protocol
    • relies on best-effort delivery
    • packets are not acknowledged
    • Designed to be simple, efficient, and straightforward to implement
  • 4. ICMP - Internet Control Message Protocol
    • Located in the Network Layer
    • Purpose is to provide error control to IP
    • Two basic types of messages:
    • error control and querying
  • 5. Common error control ICMP messages
    • 3 Destination Unreachable
    • 4 Source Quench
    • 5 Redirection
    • 11 Time Exceeded
    • 12 Parameter Problem
  • 6. ICMP Messages for Querying
    • 0 Echo Reply
    • 8 Echo Request
    • 9 Router Advertisement
    • 10 Router Solicitation
    • 13 Timestamp Request
    • 14 Timestamp Reply
    • 17 Address Map Request
    • 18 Address Mask Reply
  • 7. UDP - User Datagram Protocol
    • Transport-layer Protocol
    • Used mainly for one way, short communications
    • datagrams don’t contain information about other packets
    • Each packet independent of each other
    • Messages can be no larger than the max UDP packet size
  • 8. UDP - continued
    • Lack of error control
    • Checksum is only check, packet is dropped if incorrect
    • Relies on ICMP for error control
    • Good alternative for short messages without large communications overhead used by TCP
  • 9. TCP - Transmission Control Protocol
    • Used where reliable communications is required
    • Provisions for error control, streaming data, and two way communications
    • Connections are managed both ways using flags in the TCP packet header
  • 10. Three way handshake TCP
    • SYN(synchronize) - sent at the beginning of a connection from source host. Contains initialization information.
    • ACK(acknowledgement) - sent when packet has been received by the destination host
    • SYN - then sent by destination host
    • ACK - sent by source host
  • 11. TCP error control
    • Implemented through the ACK flag
    • Each packet numbered and a timer is started on transmission
    • Packet is retransmitted if ACK not received before timeout
  • 12. IP Packet Format - Header Length field
    • Specifies length of header
    • Is in 32-bit works
    • Maximum header size of 60 bytes
    • Normally length is 5
  • 13. Version Field
    • Carries the current version of IP
    • Currently 4 IPv4
    • Next version will be 6 IPv6
    • Also called Ipng - next generation
  • 14. Service Type Field
    • Used by some routers when deciding how to forward the datagram
    • Choices are quickest, cheapest, most reliable, or highest bandwidth
    • Datagram can be sent with no Service Type flag set
  • 15. Total Length Field
    • Overall size of the datagram in bytes including the header
    • Maximum datagram size of 65,536 bytes or 64kb
  • 16. Identification, Flags, and Fragment Offset fields
    • Used to control fragmentation and reassembly of datagrams if necessary
  • 17. Time to live field
    • Counter that is decremented every time the packet crosses a gateway.
    • When counter reaches 0 packet is discarded
  • 18. Protocol Field
    • Indicates which transport protocol is to receive the packet at the destination
    • All IP protocols (TCP,UDP,ICMP) carry checksums of their own headers and data
    • The header checksum only covers the IP header to avoid redundancy
    • Corrupt IP layer datagrams are discarded at the same layer at the receiving end
  • 19. IP Options
    • Can be used to cover the routing
    • strict- or loose-source routing
    • security and handling restrictions
    • can record the addresses of routers the datagram passes through and at what time
    • some routers ignore these options
  • 20. IP Checksum
    • Adds considerable overhead
    • IPv6 is removing this checksum
  • 21. Type of Service (TOS)
    • Allows a packet to be routed :
      • minimal delay
      • maximal throughput
      • maximal reliability
      • minimal cost
  • 22. Fragmentation and Reassembly
    • Transport layer passes data to IP
    • IP organizes data into datagram
    • If datagram is larger than Maximum Transmission Unit (MTU), IP will split data into smaller packets called fragments
    • Fragments are encapsulated in individual IP packets, sent to destination host, and then reassembled.
  • 23. Fragmentation and Reassembly
    • Packets could be routed via different routes
    • Therefore reassembly only takes place at the destination host
    • MTU’s may vary from network to network
    • If datagram containing a fragment encounters a network with a smaller MTU, the fragment is fragmented further
  • 24. Fragmentation and Reassembly
    • You can specify to the Transport layer that a datagram not be fragmented.
    • If the packet finds a network with a smaller MTU, it will be discarded and ICMP will cause an error message to be sent back
  • 25. Record Route Option
    • The route that the packet took is inserted into the IP Header in the sequence that it passed through all routers
    • The IP addresses of the routers is recorded
    • There is a limited amount of space to record this information, and data will be truncated
    • Instead use a utility like Traceroute
  • 26. Timestamp Option
    • Extension to Record Route
    • Time and date packet passed through router is recorded with its IP address
    • Same space limitations as Record Route
    • Times on routers may not be synchronized giving misleading information
    • Not a popular method and many routers don’t support it
  • 27. Source Routing
    • Specifies which route a packet follows
    • Two Methods
      • Loose-source routing (specifies a list of routers the packet must pass through, may also pass through routers not listed)
      • Strict-source routing (explicitly specifies which routers the packet must pass through, and may not travel via any that are not listed
  • 28. Source Routing
    • Many routers refuse to accept source-routed packets
    • Routing is usually controlled via the use of policy-based dynamic routing protocols
  • 29. Error Handling - ICMP
    • IP has no built in error handling
    • ICMP adds error reporting to IP
    • resides at the Network Layer
    • uses IP as its carrier
    • used for flow control as well -source quench
    • can request info i.e. timestamp, echo to ping
    • also sent in response to broadcast datagrams
  • 30. ICMP Header Format
    • ICMP messages are encapsulated in IP datagrams
    • Message has 4 parts
      • type of message (15 different types)
      • message code (subtype, 16 different types)
      • checksum (covers both header and data)
      • data (will differ depending on type and code)
  • 31. ICMP Message types
      • 8 echo request (sent by ping)
      • 0 echo reply (received by ping)
      • 3 destination unreachable
      • 4 source quench
      • 5 redirect
      • 9 router advertisement
      • 10 router solicitation
      • 11 Time exceeded
      • 12 Parameter problem
      • 13 Timestamp request
      • 14 Timestamp reply
      • 15 Information request (obsolete)
      • 16 Information reply (obsolete)
      • 17 Address mask request
      • 18 Address mask reply
  • 32. TCP and the Transport Layer
    • Lives above the IP Layer
    • adds the missing pieces to IP
    • offers
      • a way to talk to a specific application or host
      • reliable data transfer mechanism
      • way to send a continuous data stream
      • flow control of data
  • 33. The Transport Layer
    • Directs data to and from applications across networks
    • Two types of protocols are
      • connectionless (no guarantee of delivery to destination)
      • connection-oriented (establish connection, transfer data, close connection)
  • 34. Connection Oriented
    • Two-way connection
    • Similar to that of a telephone conversation
    • Reliable
    • guaranteed delivery of data
  • 35. TCP Frame Format
  • 36. Frame Format
    • TCP supports full duplex, byte-stream-oriented communication between processes
    • The data stream must be broken into segments that can be encapsulated in IP datagrams for transmissions
    • “ Source Port” and “Destination Port” identify the sending and receiving applications
  • 37. Sequence Number
    • Indicates the position of this segment in the data stream
  • 38. Acknowledgment Number
    • Indication of how much of the data stream has been successfully received
  • 39. HLEN
    • 4-bits , gives the length of TCP in 32-bit words-max size 60 bytes-norm size 20 bytes
  • 40. Code Bits field
    • Flags for reset,sync,finish,etc. reside here
  • 41. Window Field
    • Indicates how many bytes the receiver can accept
  • 42. Checksum
    • Covers data in the segment, its header and the source and destination IP addresses and protocol value from the IP address
  • 43. Urgent Pointer
    • Mechanism for sending urgent data along with normal data
  • 44. Options
    • Similar to IP, options can be added to the header
  • 45. TCP Handshaking
    • Six flags
      • SYN Sync seq #’s to initiate a connection
      • ACK Acknowledgment frame
      • RST Reset the connection
      • URG Urgent incoming data
      • PSH Pass data onto the app ASAP
  • 46. TCP Flow Control
    • Indicates how many bytes of data can safely be received at any time, called the window
    • Window size is the max # of bytes that can be sent without receiving an ACK.
    • Receiver stores up segments regardless of the order they arrive in.
    • If duplicate segments are received they are discarded
  • 47. Ports and Sockets
    • A method for piping a data flow to and from a particular application
    • A socket is a pair of data queues for an application process (one send one receive)
    • A port is an address on a socket
    • Incoming data is bound via its port address to a socket
  • 48. Port Numbers
    • Servers listen on specific ports waiting for clients (RFC 1700)
    • Ports 1 to 1023 are managed by IANA (InterNet Assigned Numbers Authority)
      • reserved for well-known services
      • known as privileged ports