CS 422 Class Notes, Fall 2003

Week 14: Nov 24th - Nov 28th

 

 

Internet Protocols

 

 

Two transport protocols: UDP and TCP

        - UDP: unreliable

        - TCP: reliable

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

IP: - provides computer to computer communication

       - source and destination are machines

       - IP is called a machine to machine protocol

 

Transport Protocols: - provides application to application communication

                                        - inside a machine they need addressing mechanisms called ports

                                        - a port is like a mailbox in the machine

                                        - they are also called end-to-end protocols

                                        - optionally, transport protocols should provide reliability but not all transport

                                          protocols provide it (e.g. UDP)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

UDP: - unreliable

            - best for LAN applications

            - minimal overhead network (smaller header) since no initial connection

            - each message is stored in an IP Packet

 

   

IP header

UDP header

Data

 

 

                ⌠               ⌡

                                   

src port

dest port

checksum

 

    - SRC port and DEST port tells us the src and dest applications

 

 

Uses of UDP: - real time data (voice, video) where having data on time is more important than reliability

                           - broadcast of packets:

                                    + find the name of a server automatically

                                                + programs like 'rusers' that queries the machines in the network

 

Disadvantage of broadcast: - wastes the CPU time of all the computers in the network that might not

                                                        be interested in the packet

                                                     - each broadcast causes an interrupt in each machine in the network

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

If your network application needs reliability, use TCP instead of UDP

 

TCP: - major transport protocol in the internet

           - reliable

           - connection oriented:  tcp needs to set up the connections before the communication starts

           - stream interface: reading/writing from a socket will be like reading/writing to a file

 

TCP offers the following features:

                - Adaptive retransmission: automatically adjusts the retransmission timer

                - Flow control: it slows the transmission of data in the sender, if the receiver is not

                  consuming the data

                - Cumulative acknowledgements: cumulative acknowledgements acknowledges all the data

                   received in sequence so far

                - Slow start

                - Three way handshake: reliable connection setup

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~