TCP, UDP, IP - PowerPoint PPT Presentation

1 / 43
About This Presentation
Title:

TCP, UDP, IP

Description:

Best-try datagram (or ... all 0's or all 1's as a host number: - all 0's is the subnetid ... number of the application program in the sending host. ... – PowerPoint PPT presentation

Number of Views:88
Avg rating:3.0/5.0
Slides: 44
Provided by: ValuedGate1569
Category:
Tags: tcp | udp | best | hosting

less

Transcript and Presenter's Notes

Title: TCP, UDP, IP


1
Chapter 4
TCP, UDP, IP
2
TCP/IP Protocol Suite
  • De-facto standard for open system
    interconnection.
  • Provide highest degree of interoperability.
  • Usually resides in O/S, shared by all application
    programs running on the machine.

3
An Internet According to TCP/IP
4
TCP/IP and the OSI Model
5
RFC (Request for Comments)
  • Documentation for TCP/IP Protocols
  • Available on-line from
  • - Network Information Center, www.nic.mil
  • - other mirror sites
  • Examples
  • - IP, RFC 760
  • - TCP, RFC 761
  • - FTP, RFC 959
  • - HTTP, RFC 2068

6
IP (Internet Protocol)
  • Described in RFC 760.
  • Responsible for communication at the computer
    level (i.e. host-to-host communication).
  • Best-try datagram (or connectionless) service.
  • Data transferred across the Internet (datagram)
    is self-contained, individually-addressed.
  • IP is independent of underlying network
    technologies.
  • IP address is used to determine the source and
    destination of a datagram.
  • Operate in layer 3 (network layer) of the OSI
    model.

7
IP Datagram
8
  • VER
  • Defines version of the IP.
  • HLEN (Header length)
  • Defines the length of the datagram header in
    4-btye words.
  • TOS (Type of Service)
  • For specifying special handling of the packet
    Replaced by Differentiated Services to handle the
    shortcomings of Integrated Services.
  • Total Length
  • Defines the total length (header plus data) of
    the IP datagram in bytes.
  • Identification, Flags, Fragmentation offset
  • These fields are related to fragmentation and
    reassembly of an IP diagram.

9
  • Time To Live (TTL)
  • Defines the maximum time for which a datagram is
    allowed to be in transit across the Internet.
    But, in practice, it counts hops.
  • Protocol
  • Defines the higher-level protocols that uses the
    services of the IP layer
  • e.g. TCP (6), UDP(17), OSPF(89).
  • Checksum
  • It covers only the header, not the data.
  • Source IP address
  • Defines the IP address of the source.
  • Destination IP address
  • Defines the IP address of the destination.
  • Option
  • Used for network testing and debugging.

10
Example of checksum calculation
11
Maximum Transmission Unit ( MTU)
12
Fragmentation example
13
Internet Address
14
Internet Classes
15
IP Address Range
16
Private Address
  • Address ranges defined for use within private
    intranets
  • Can be used without registration
  • Class A
  • 10.0.0.0 to 10.255.255.255
  • Class B
  • 172.16.0.0 to 172.31.255.255
  • Class C
  • 192.168.0.0 to 192.168.255.255

17
Network and Host Addresses
18
A Network with Two Levels of Hierarchy
19
A Network with Three Levels of Hierarchy
20
Subnetwork Address
  • Allow standard class address to be further
    subdivided for routing within an organization.
  • Subnet mask is used to divide a network into
    subnets.
  • Cannot define all 0s or all 1s as a host
    number
  • - all 0s is the subnetid
  • - all 1s is the subnet broadcast address

21
Example 1
 
  • Determine the netid, subnetid, hostid, subnet
    broadcast address of the following IP address
  • 10.84.60.5 / 255.240.0.0
  • Answer
  • netid 10
  • subnetid 10.80.0.0
  • hostid 4.60.5
  • subnet broadcast 10.95.255.255

 
22
Example 2
  • With the following subnet assignment, list all
    available subnet addresses
  • 192.60.20.0 / 255.255.255.224
  • Answer
  • 192.60.20.32, 192.60.20.64
  • 192.60.20.96, 192.60.20.128
  • 192.60.20.160, 192.60.20.192

23
Transport Layer Process-to-Process Delivery
24
Port numbers
25
IP addresses versus port numbers
26
Socket address
IANA ranges
27
Well-known ports used by TCP
28
Well-known ports used by UDP
29
TCP (Transmission Control Protocol)
  • Described in RFC 761.
  • Responsible for delivery of the message to the
    appropriate program (process-to-process
    communication).
  • Provide a reliable, end-to-end, byte stream (data
    pipe) over an unreliable internetwork.
  • Operate in layer 4 (transport layer) of the OSI
    model.
  • Default segment size 556 bytes (20 536).
  • Error-detection by CHECKSUM field.
  • Flow-control by Sequence No., Acknowledgement No.
    and Window Size.

30
TCP Segment Format
31
  • Source port address
  • Defines the port number of the application
    program in the sending host.
  • Destination port address
  • Defines the port number of the application
    program in the receiving host.
  • Sequence number
  • Defines the number assigned to the first byte of
    data contained in the segment.
  • Acknowledgement number
  • Defines the byte number that the sender of the
    segment is expecting to receive from the other
    party.
  • Header length
  • Indicates the number of 4-byte words in the TCP
    header.

32
  • Reserved
  • Reserved for future use.
  • Control bits
  • One or more of these bits can be set at a time.
    These bits enable flow control, connection
    establishment and termination, and the mode of
    data transfer in TCP.
  • Windows size
  • Defines the size of window in bytes.
  • Checksum
  • Used to detect errors over the entire segment
    (header plus data).
  • Urgent pointer
  • It is used when the segment contains urgent data.
    The number is added to the sequence number to
    obtain the number of the last urgent byte in the
    data section of the segment.
  • Options
  • Up to 40 bytes of option information.

33
Description of flags in the control field
34
Example 1
Imagine a TCP connection is transferring a file
of 6000 bytes. The first byte is numbered 10010.
What are the sequence numbers for each segment if
data are sent in five segments with the first
four segments carrying 1000 bytes and the last
segment carrying 2000 bytes?
Solution
The following shows the sequence number for each
segment Segment 1 gt sequence number
10,010 (range 10,010 to 11,009) Segment 2
gt sequence number 11,010 (range 11,010 to
12,009) Segment 3 gt sequence number
12,010 (range 12,010 to 13,009) Segment
4 gt sequence number 13,010 (range 13,010 to
14,009) Segment 5 gt sequence number
14,010 (range 14,010 to 16,009)
35
Three-step connection establishment
36
Four-step connection termination
37
Sliding Window
  • A sliding window is used to make transmission
    more efficient as well as to control the flow of
    data so that the destination does not become
    overwhelmed with data. TCPs sliding windows are
    byte-oriented.
  • In TCP, the sender window size is totally
    controlled by the receiver window value (the
    number of empty locations in the receiver
    buffer). However, the actual window size can be
    smaller if there is congestion in the network.

38
Lost segment
39
Lost acknowledgment
40
UDP (User Datagram Protocol)
  • Described in RFC 768.
  • UDP is a connectionless, unreliable protocol that
    has no flow and error control. It uses port
    numbers to multiplex data from the application
    layer.
  • The calculation of checksum and its inclusion in
    the user datagram are optional.
  • UDP is a convenient transport-layer protocol for
    applications that provide flow and error control.
    It is also used by multimedia applications.

41
UDP Datagram Format
42
Why UDP?
  • Simple
  • Less overhead, 8 bytes header in UDP vs 20 bytes
    header in TCP
  • No acknowledgement, therefore much less delay in
    communication.
  • Less computer resources requirement, e.g.
    buffers.

43
Common UDP Applications
  • Characteristics of UDP applications
  • single packet based transaction (request, reply
    or update)
  • distributed servers
  • no pre-determined server
  • loss of packets does not affect service
  • Examples SNMP, BOOTP, DNS, DHCP, RIP
Write a Comment
User Comments (0)
About PowerShow.com