UNESCOCISM SECOND ADVANCED SCHOOL OF INFORMATICS UNESCO PROJECT Advanced Course on Networking TCPIP - PowerPoint PPT Presentation

1 / 83
About This Presentation
Title:

UNESCOCISM SECOND ADVANCED SCHOOL OF INFORMATICS UNESCO PROJECT Advanced Course on Networking TCPIP

Description:

RARP (Reverse ARP) ... TCP as a telephone call. Make a connection ring number. Verifies connectivity ... could have a simple lookup table that is manually ... – PowerPoint PPT presentation

Number of Views:65
Avg rating:3.0/5.0
Slides: 84
Provided by: AlBe8
Category:

less

Transcript and Presenter's Notes

Title: UNESCOCISM SECOND ADVANCED SCHOOL OF INFORMATICS UNESCO PROJECT Advanced Course on Networking TCPIP


1
UNESCO/CISM SECOND ADVANCED SCHOOL OF
INFORMATICSUNESCO PROJECT Advanced Course on
Networking TCP/IP
2
Content
  • Internet Layer Protocols
  • IP, ARP, RARP, ICMP.
  • Transport Layer Protocols
  • UDP
  • TCP
  • Applications
  • DNS
  • Some services

3
TCP/IP Support Protocols
4
IP Protocol
  • Internet Prococol
  • provides the packet delivery service for TCP, UDP
    and ICMP
  • user processes do not normally explicitly
    generate IP datagrams
  • Address Resolution Protocol maps an Internet
    address into a hardware address
  • Reverse Address Resolution Protocol
  • maps a hardware address into an Internet address.

5
IP datagram structure
  • an IP datagram consists of a header parts and a
    text part
  • header has a 20 byte fixed part and a variable
    length optional part
  • type of service field allows different
    combinations of reliability and speed to be
    chosen
  • for digital speech IP can be told to emphasize
    fast delivery
  • for file transfer is taking IP can be told that
    accuracy is paramount at the expense of speed.

6
IP Datagram Fields
7
IP Datagram Fields
  • total length length of both header and data
  • identification all fragments of a datagram
    contain the same id value host can determine
    which datagram an incoming fragment belongs
  • DF do not fragment
  • MF more fragments (All fragments except last
    one must have this bit set to true )
  • Fragment offset must be a multiple of 8. Tells
    receiver where this fragment belongs in the
    datagram.
  • Time to live in seconds. Decrements each second
    or each hop, when it reaches 0 it is thrown away
  • Protocol field tells which of the various
    transport processes the datagram belongs, ie.,
    TCP or UDP
  • Header checksum verifies header only
  • Source and destination address indicate the
    network number

8
IP addressing
  • internet is a virtual structure
  • implemented entirely in software
  • packet frames and addresses were designed on
    merit
  • addresses contained with 4 bytes
  • conceptually the 32 bit number has two parts
  • hostid
  • netid
  • three primary classes of IP addresses

9
IP address classes
10
IP address classes
  • class A
  • a handful of network which have more than 65536
    hosts
  • class B
  • addresses for intermediate size networks.
    256..65535 hosts. 14 bits for netid 16 bits for
    hostid
  • class C
  • networks which have less than 256 hosts
  • class D
  • multicast, hosts may dynamically join/leave
    multicast group
  • hosts may be in many different multicast groups

11
Network structure
12
Network structure
210.112.1.5
13
Network and Broadcast addresses
  • two reserved hosted-s
  • Internet addresses can be used to refer to
    networks as well as network cards. By convention
    the network address has hostid all bits 0
  • a broadcast address conversely has hostid bits
    all 1
  • one of the weakness of IP addressing is that if a
    machine changes network - its IP address must
    change

14
Fragmentation and reassembly
  • IP datagrams may be fragmented en route
  • if intermediate nodes cannot cope with a large
    datagram (MTU (maximum transmission unit) is
    smaller than datagram size)
  • IP datagrams may be reassembled en route
  • although not a good idea as routing is dynamic.
    (So datagrams may not always travel the same
    route)
  • to fragment a datagram into two a node creates
    two new datagrams with same fragment ids
  • the first offset is 0, MF 1
  • the second offset is n, MF 0

15
Fragmentation and reassembly
  • consider trying to send a 1420 byte datagram when
    the MTU is 620
  • 1420 1400 data 20 IP header
  • split into 3 packets
  • first packet length 620 20 new IP header
    600 old data, offset 0
  • second packet length 620 20 new IP header
    600 old data, offset 600
  • third packet length 220 20 new IP header
    200 old data, offset 1200
  • the new fragments have the same unique frag id as
    the original why?
  • reassembly reverses this process

16
IP Support Protocols
  • ICMP (Internet Control Message Protocol)
  • sends control information between the hosts
  • routers generate most of this information
  • routers use ICMP to
  • inform hosts that a packet could not be delivered
    because of an error
  • or a better route exists to a particular
    destination
  • ICMP messages are send using IP frames
  • ICMP messages use the IP protocol field and set
    it to 1

17
Typical ICMP messages are
  • destination unreachable - when a router cannot
    find a routing table entry for the destination of
    an IP packet
  • routing redirect - a router sends a routing
    redirect message to inform a host that a better
    route exists via another router
  • time expired - message indicates a packets ttl
    field has reached 0
  • usually because of a configuration error
  • malfunctioning router
  • echo request and echo reply - echo request
    messages request that the destination return the
    data in an echo reply message (ping)

18
Address Resolution Protocol
  • IP address space is virtual and has no addressing
    relationship with the underlying datalink
    protocols
  • every network interface has an IP address
  • every network interface has a datalink address
  • datalink addresses vary in format and size
  • suppose IP is sending a packet to a remote host
    on the same Ethernet
  • IP needs destination Ethernet address
  • could manually keep track of hosts and their
    interface card datalink addresses

19
Address Resolution Protocol
  • clearly on a large network this becomes
    unmanageable
  • ARP (Address Resolution Protocol) is an automatic
    method which maps any network level address (IP
    address) to datalink address
  • ARP does this by exploiting the broadcast
    capability commonly found in most LAN datalink
    protocols

20
RARP (Reverse ARP)
  • ARP maps from network addresses to datalink
    addresses
  • sometimes you require the opposite mapping
  • many machines can read their datalink hardware to
    find out the datalink address
  • but then needs to find out its IP address
  • for example, disk less workstation, X terminal,
    printer

21
RARP (Reverse ARP)
  • at least one host on the IP network must contain
    a list of IP addresses with corresponding
    datalink addresses
  • whereas ARP does not require that this list is
    present
  • a RARP is a broadcast request - any host may
    reply
  • the sender fills in its datalink address
  • its network address is filled with zeros
  • specifies the target datalink address (normally
    the same as sender)
  • the RARP server fills in the requested IP
    (network) address
  • RARP is normally the first step taken when a
    diskless workstation it powered up
  • once it knows its own IP address it can then
    proceed to load its operating system from a
    network server by using a simple file transfer
    protocol (TFTP)

22
Transport Layer Protocols
  • TCP and UDP

23
Transport Layer Protocols
  • 2 main protocols TCP UDP
  • TCP transmission control protocol
  • Connection oriented
  • Reliable sequence of numbered segments
    acknowledgments with any required
    re-transmissions
  • Flow control sliding windows
  • UDP user datagram protocol
  • Connectionless
  • Unreliable delivery of single segments
    (datagrams)
  • Errors detected but not corrected (No acks)

24
TCP/UDP analogies
  • TCP as a telephone call
  • Make a connection ring number
  • Verifies connectivity
  • Use connection communicate
  • Reliability can you repeat that please?
  • Flow control normal human courtesy
  • Close connection receiver down
  • UDP as a letter
  • Write it, address it, post it, hope it gets there

25
TCP vs UDP
  • Relative merits
  • TCP
  • Reliable
  • High network overheads
  • Complex and large software
  • UDP
  • Unreliable (may not be a problem)
  • Low network overheads
  • Simple and small software

26
When to use UDP
  • Use TCP unless there is a reason for UDP
  • Possible reasons to use UDP
  • When the network efficiency is needed
  • (SNMP)
  • When the sw simplicity is needed
  • (Bootstrap loading)
  • When the reliability of TCP is counter-productive
    (Stream audio/video)

27
User Datagram Protocol (UDP)
  • UDP and the TCP/IP layered model
  • UDP message format
  • UDP and encapsulation
  • UDP checksum

28
UDP And The TCP/IP Layered Model
29
Multiplexing and Demultiplexing 1
30
Multiplexing and Demultiplexing 2
31
How Do We Allocate Port Numbers?
  • Well known port numbers
  • Dynamic binding

32
Port numbers
  • 0 to 255 public port numbers
  • 256 to 1023 assigned to companies for
  • their own marketable apps
  • 1024 unregulated

33
Examples of public ports
34
UDP Message Format
35
UDP and Encapsulation
36
UDP Checksum
  • Optional checksum calculated on
  • UDP datagram
  • UDP pseudo-header
  • Does this violate layering?

37
UDP Checksum
38
Differences between TCP UDP
39
Properties of a Reliable Delivery Service
  • Stream Orientation Application just transfers a
    stream of bytes
  • Virtual Circuit Connection Is TCP VC?
  • Buffered Transfer TCP decides what size TCP
    messages are, not user
  • Unstructured Stream There is no structure in
    the stream of bytes as far as TCP is concerned
  • Full Duplex Connection Can transfer data in
    both directions simultaneously and independently

40
Positive Acknowledgement A Simple Example
41
Positive Acknowledgement Packet Doesnt Arrive
42
Positive Acknowledgement ACK Doesnt Arrive
43
Round Trip Time (RTT)
44
Round Trip Time (RTT)Estimate too low
45
Round Trip Time (RTT)Estimate too high
46
Sending Multiple Packets
  • Receiver may not be able to process packets as
    fast as they arrive
  • In fact ACKs serve at least 3 different purposes
  • Recovery from lost packets
  • Limit the rate at which sender can send packets
  • Control congestion in the network
  • Compromise solution is required
  • The Sliding Window

47
Sliding Windows Example
  • Given a window size 6 packets
  • A has sent packets 1 to 7
  • A has received ACKs 1 to 4

48
Sliding Windows ACK Received
  • A receives ACK 5 and the window slides to the
    right

49
Sliding Windows Packet 8 sent
  • A sends Packet 8 and the window remain unchanged

50
Sliding Windows Packet 9 sent
  • A sends Packet 9 and the window remain unchanged

51
Sliding Windows Packet 6 ACK-ed
  • A receives ACK for Packet 6 and the window slides
    to the right

52
Sliding Windows Packet 6 ACK-ed
  • A sends packets 10, 11, and 12. No ACK received ?
    no more packets can be sent.

53
Sliding WindowsWindow size?
  • Different protocols fix the window size in
    different ways
  • Fixed by protocol specification
  • Agreed when connection established
  • Adjusted whilst connection in progress
  • (Demo is given later)

54
Sliding Windows Missing ACKs ?
  • With just one outstanding ACK it was easy. If A
    doesnt get an ACK it sends the packet again
  • With several ACKs outstanding it gets much more
    complicated
  • What does A do when it detects a missing ACK?
  • What does B do when it detects a missing packet?
  • Different protocols use different solutions

55
Sliding Windows Missing ACKs ?
  • There are two extreme positions
  • When something goes missing A resends every
    packet starting with the first unacknowledged
    packet.
  • This is called Go-Back-N.
  • When something goes missing A B co-operate to
    just resend those packets B hasnt received.
  • This is called Selective Retransmission.

56
TCP Encapsulation
57
TCP Header
58
TCP Header Fields
  • Source Port Port number of sender of segment
  • Destination Port Port number of intended
    recipient
  • Sequence Number TCP uses byte numbers not
    packet numbers
  • Acknowledgement Number Number of the byte the
    sender of this segment expects next
  • Window The size of the sliding window in bytes
  • Checksum Just like the UDP checksum
  • Control bits Special purpose bits
  • Data User data

59
Usage of SEQ-ACK-WIN Fields Example
60
TCP is Complicated
  • RFC 793 is over 90 pages long but doesnt cover
    everything
  • There are a number of additional RFCs covering
    various aspects of TCP
  • There are a number of reference implementations
    which have performance enhancing features
  • There is no single TCP specification

61
Next TCP continues
  • Establishing A TCP Connection
  • Timeouts and Retransmission
  • Congestion
  • Closing A TCP Connection

62
TCP Connections
  • There are obviously two end points to a
    connection
  • An end point is identified by a combination of
    host IP address port number
  • One end point that initiates the connection. This
    performs an active open
  • One end point that accepts the connection. This
    performs a passive open
  • The passive open must occur before the active
    open can succeed
  • The passive end point can support multiple
    connections

63
Establishing A TCP Connection
64
Timeouts and Retransmission
  • Selecting the correct value for the timeout is
    crucial to efficiently implementing TCP.

65
Round-Trip Time (RTT)
66
Round-Trip Time (RTT)
  • RTT varies according to
  • Different hosts
  • Different times of day
  • Even from second to second
  • If we need to retransmit then what is the RTT?
  • Time from original transmission to receiving ACK
  • Time from last retransmission to receiving ACK

67
Measuring RTT Karns Algorithm
  • Ignore retransmission when trying to estimate RTT
  • Increase timeout value until transmission
    succeeds
  • Then recalculate RTT when retransmission no
    longer needed

68
Estimating Timeout ValueOriginal Method
  • rtt ALPHA rtt ( 1 ALPHA ) sample
  • timeout BETA rtt
  • 0 ALPHA
  • BETA 1 typically 2

Last Measured value
69
RTT trajectory using Karns Algorithm
70
RTT Karns Algorithm
71
Estimating Timeout Value Revised Method
  • diff sample rtt
  • rtt rtt DELTA diff
  • dev dev RHO ( abs(diff) dev )
  • timeout rtt ETA dev
  • 0
  • 0
  • ETA 1 typically 3

72
Slow-Start (Additive) Recovery
  • When starting a new connection or increasing
    traffic after congestion is over
  • congestion window one segment
  • for each ACK received
  • congestion window congestion window one
    segment

73
Multiplicative Decrease Congestion Avoidance
  • Sender also maintains a congestion window
  • If a segment is lost then
  • congestion window MIN (congestion window/2 ,
    one segment )
  • allowed window MIN ( receive window, congestion
    window )
  • ? increase retransmission timer for all segments
    in allowed window

74
How does it work?
75
How does it work?
Exponential Increase
Exponential Increase Increase CW with for each
received ACK
76
How does it work?
Can be 64 Kbyte
Exponential Increase
77
How does it work?
Linear Increase Increase CW with one for
each ACK-ed Window
Exponential Increase Increase CW with for each
received ACK
78
How does it work?
Linear Increase
Probably due to loss or congestion
Exponential Increase
79
Closing A TCP Connection
80
Applications
  • Naming and infrastructure
  • there is a need for a mapping of textual domain
    names to numeric IP addresses
  • difficult to remember 193.63.130.52 is the class
    C address for floppsie!
  • also require services such as a consistent time
    between different machines

81
Domain Name Service (DNS)
  • the Internet standard DNS maps host names, such
    as floppsie.comp.glam.ac.uk to IP addresses such
    as 193.63.130.52
  • DNS namespace is partitioned hierarchically into
    a tree
  • glam.ac.uk - may map onto several class C
    networks
  • floppsie.comp - indicates a machine within the
    computer studies network
  • an interface card on class C network
    193.63.130.xx

82
Naming and infrastructure
  • we could have a simple lookup table that is
    manually updated
  • soon becomes unmanageable
  • use a dynamic mechanism, domain name service
  • have a machine which will keep track of IP
    addresses and ASCII names
  • if it cannot resolve a name it requests help from
    another machine higher up the tree
  • the DNS protocol specifies how DNS clients ask
    DNS servers for mappings
  • and how DNS servers communicate with each other.

83
More Applications
  • E-mail SMTP (MIME), POP3, IMAP
  • FTP File Transfer Protocol
  • Telnet Remote Login
  • HTTP HyperText Transfer Protocol (WWW)
  • NFS Network File System
  • DHCP Dynamic Host Configuration Protocol
Write a Comment
User Comments (0)
About PowerShow.com