INTERNETWORKING: Part III


PROTOCOL LAYERING
The need for Multiple protocols
Complex data communication systems do not use a single protocol to handle all transmission tasks- they require a set of cooperative protocols called a protocol family or protocol suite
Problems: 1. Hardware Failure
                        2. Network Congestion
                       3. Packet Delay Or Loss
                        4. Data Corruption
                        5. Data Duplication Or Inverted Arrivals
The protocol software  is partitioned into different layers
            
The Conceptual layers of protocol software
The protocol software on each machine is stacked vertically into layers
Each layer takes responsibility for handling one part of the problem  and make decisions about the correctness of the message and chooses an appropriate action based on the message type or destination address
The conceptual organization  of protocol software in layers
FUNCTIONALITY OF THE LAYERS
X.25 and the relation to the OSI Model
 X.25- established by ITU and adopted by public data networks(operates like telephone system)
 -   It consists of complex packet switches that contain intelligence to route packets
 - A host is connected to one of the packet switches(not directly connected to the wires) using serial communication line
PHYSICAL LAYER: specifies a standard for the physical interconnection b/w host and switches and procedures to transfer packets
DATA LINK LAYER: specifies how data travels between a host and a switch (frames are used as data unit, specifies the format of the frames and how machines recognize the boundaries). HDLC(High Level Data Link Communication) protocol is used
NETWORK LAYER:  respond to network congestion problems
Transport LAYER: end-toend reliability(checks whether no machine in the middle failed)
SESSION LAYER:
considered remote login. The carrier uses PACKET ASSEMBLER and DISASSEMBLER(PAD), the travelers can use a modem  to dial up the PAD  and made a network connection to a host computer and logged in.
PRESENTATION LAYER: provide functions that many application programs use. Eg  standard routines that compress text or convert graphics  images into bit streams for transmission across the network
APLLICATION LAYER: application programs that use the network eg Email or file transfer programs 
 
TCP/IP 5-layer Reference Model
APPLICATION LAYER:  interacts with transport layer protocols to send/recieve data. Passes data in required form. Chooses style of transport
TRANSPORT: communication from one application program to another. Regulate the flow of information. Provide reliable transport ensuring data arrives without error and in sequence
INTERNET LAYER: communication from one machine to another. It encapsulates the packet in an datagram and uses the forwarding algorithm to determine where to deliver
NETWORK INTERFACE LAYER: consists of device driver ( that accepts the datagram and transmitting over a network)
The protocol layering principle
1.The LAYERED protocols are designed so that layer n at the destination receives exactly the same object sent by layer n at the source
2.It allows the designer to focus attention on one layer at a time, without worrying about how other layers perform
Two boundaries in TCP/IP Model
High-level protocol address boundary
       INTERNET LAYER- Only IP addresses used
        NETWORK INTERFACE LAYER- physical       addresses used
Operating system boundary
   APPLICATION LAYER- s/w outside the OS
 TRANSPORTLAYER- s/w inside the OS

      User Datagram Protocol
Identifying Ultimate Destination
The executing programs are known as process, task, application program or user level process.
The process is the ultimate destination for a message
Instead of process as ultimate destination, imagine each machine contains a set of abstract destination points called protocol ports
Each protocol port is identified by a positive number
The local operating system provides the mechanism that processes use to specify a port or access it.
The ports are buffered in a queue until a process extracts them
To communication with a foreign port, a sender need to know the IP address of the destination machine and the protocol port number of the destination within that machine
Each message must carry  the destination port number and the source port number to send replies 
UDP- provides an unreliable connectionless delivery service using IP in transport messages between machines.
It uses IP to carry messages but adds the ability to distinguish among multiple destinations within a given host computer
FORMAT OF UDP MESSAGES
Each UPD message is called a user datagram
containing two parts: UDP header and UDP data area
The source port is optional. When used, it specifies the port to which replies to be sent, if not used, it should be zero.
LENGTH:  contains count of octets in the datagram (including the header and user data).
    The minimum value is 8, the length of header alone
CHECKSUM: is optional, the value zero  means checksum has not been computed. It provides the only way to guarantee that data has arrived intact and should be used
UDP PSEUDO- HEADER
Purpose of pseudo-header: to verify that UDP datagram has reached its correct destination
To compute checksum, UDP prepends a pseudo-header to the UDP datagram , appends an octet of zeros to pad the datagram to an exact multiple of 16 bits and computes the checksum over the entire object
The UDP on the sending machine computes a checksum that covers the destination IP address as well as the UDP datagram
At the destination, UDP software  verifies the checksum using the destination address obtained from the IP datagram.
If the checksums agree, then it must be true  that datagram has reached the intended destination host as well as correct protocol port
12 Octets of the Pseudo header
PROTO: contains IP protocol type (17 for UDP)
UDP LENGTH: contains length of UDP datagram (not including pseudo header)
To verify checksum, the receiver must extract these fields from the IP header , assemble them into a pseudo-header format  and recompute the checksum
UDP ENCAPSULATION and protocol layering
Reserved and Available UDP ports
Two computers must agree on port numbers before they interoperate
Two approaches to port assignment
     1. Universal assignment: allow a central authority to assign port numbers as needed and to publish the list of all assignments. The port assignments specified by the authorities are called well-known port assignments
      2. Dynamic Binding: ports not globally known. Whenever a program need a port, the network software assigns it
                To learn about the current port assignments on other computer, request is send to ask the current port assignments
Eg. Decimal   Keyword       UNIX keyword      Description
          11           USERS             systat                     Active Users
          Reliable Stream Transport   Service(TCP)
The need for stream delivery
In packet switching system, packets changes routes dynamically and deliver packets out of order and sometimes lost
Underlying network technologies may dictate an optimal packet size or pose other constraints needed to achieve transfer rates
In unreliable connectionless, it requires programmers to build error detection and recovery into each application program 
These drawbacks are handles by using reliable stream delivery allows the expert to build a single instance of stream protocol software that all application programs use. It helps to isolate the application program from the details of networking
Properties of the reliable delivery service
Stream Orientation”: The large volumes of data is viewed as a stream of bits, divided into 8-bit octet or bytes.
     The stream delivery service on the destination machine passes to the receiver exactly the same sequence of octets that the sender passes to it on the source machine.
Virtual Circuit: Stream transfer is analogous to placing a telephone call . This term is used to describe the connections between the source and destination
    The protocol software modules in two OS communicate by sending msgs, verifying the transfer is authorized and both sides are ready . Then protocol modules inform the application programs that the connection  has been established and that transfer can begin. Any failure during transfer, both machines detect it and inform to the appropriate application program
Buffered Transfer: the buffer is filled and transferred. For application programs not using buffer, has push mechanism for immediate transfer and it may choose to divide the stream in unexpected way
Unstructured Stream: no structured data streams are passed. No way to have stream service mark boundaries between employee record in payroll. The application programs must understand the content and agree of stream format before initiating the connection.
Full duplex connections: connections provide concurrent transfer in both the directions
Providing Reliability
Technique is known as positive acknowledgement with retransmission – requires  the recipient to send ACK back to the source and then next packet is sent
Disadv: it  wastes network bandwidth  since it delay until it receives the acknowledgement
Sliding window:  protocol places a small fixed size window on the sequence and transmits all packets that lie inside the window                                                                                                                                                                                                                   
What does TCP provides
The protocol specifies the format of the data and acknowledgements that two computers exchange
It provides the procedures to ensure the data arrives correctly
It specifies how TCP software distinguishes among multiple destinations on a given machine
It specifies how two computers initiate a TCP stream transfer and how they agree when it is complete 
What TCP does not provide
It does not dictate the details of the interface between an application program and TCP
It does not specify the exact procedures application programs invoke to access these operations
Ports, connections and endpoints
TCP uses the connection, not the protocol port as its fundamental abstraction.
Connections are identified by  a pair of endpoints
TCP defines an endpoint to be a pair of integers ( host, port).
     host- IP address for a host
    port- is the TCP port on that host
Eg: endpoint (128.20.2.3, 25) specifies
TCP port 25 on the machine with IP address 128.10.2.3
If there is a connection between machine(18.26.0.36)  at MIT to machine (128.10.2.3) at pune university, it is defined as
       (18.26.0.36, 1069) and (128.10.2.3,25)
A given TCP port number can be shared by multiple connections on the same machine
 eg.  We can add another connection from machine (128.2.254.139,1184) at pune machine
Endpoint: (128.2.254.139,1184) and (128.10.2.3,25)
Passive and Active opens
Before TCP traffic can pass across an internet, application programs at both ends of the connection musty agree
TO do so, the application program on one end performs a passive open function by contacting its OS and indicating that it will accept an incoming connection. At that time OS assigns an TCP port number for its end of connection
At the other end, application program must then contact its OS using an active open request to establish a connection  
The two TCP software modules communicate to establish and verify its connection
Once a connection has been created , application programs can begin to pass data.
Then TCP at each end guarantees reliable delivery
TCP Segment Format
The unit of transfer between the TCP software on two machines is called a segment
Segments are exchanged to establish a connections, transfer data, send acknowledgements, advertize window size and close connections
Format of TCP Segment Format
Each segment is divided into 2 PARTS : header and data
Ports are used identify the application programs at the ends of the connection
SEQUENCE No: identifies the position in the sender’s stream of bytes of data.
ACKNOWLEDGEMENT NO: identifies the octet that the source expects to receive next
HLEN: contains an integer that specifies the length of the segment header
RESERVED: is reserved for future use
CODE BITS: to determine the purpose and contents of the segment(whether data or ACK)
WINDOW : specifies the window size
The six code bits tell how to interpret other fields
    Bits(Left to right)             Meaning if set to 1
         URG  Urgent pointer field is valid
        ACK          Ack field is valid
        PSH           This segment requires a push
       RST            Reset the connection
       SYN            Synchronize  sequence numbers
       FIN        Sender has reached end of its         byte stream
Establishing a TCP Connection
Distance vector routing algorithm
Each router keeps a list of all known routes in a table.
When it boots, a router initializes its routing table to contain an entry  for each directly connected network
Each entry identifies the destination network and gives the distance(hops) to that network
   eg Destination       distance       Route
          Net1                     0                  Direct
           Net4                    8                  router L
Periodically each router sends a copy of its routing table and gives the distance to that network
Router J may send a report a router K  containing data
         Destination                          Distance
            Net1                                        2
            Net4                    3
The marked entries are updates in the K router table  with the distance N+1  and  the route is J
Adv: easy to implement
Disadv: In completely static environment, distance-vector algorithm computes shortest path and propagates routes to all destinations
But , 
    when routes changes rapidly, computations may not stabilize. When route changes, the information propagates slowly from one router to another. Meanwhile some router may have incorrect routing information
  
Link State (SPF)or shortest path First   Routing
Each router has a map that shows all other routers and the networks to which they connect
A router performs two tasks
      a) it actively tests the status of all neighbor routers. To test the status , the  two neighbors exchange message to verify the neighbor is alive and reachable. If the neighbor replies, the link is up otherwise down
      b) Periodically propagates message that lists the status of each of its link. Status message does not specify the route but reports whether communication is possible between pair of routes
The protocol software deliver the copy of each link status to all participating routers
Whenever a link status changes, the router recomputes  routes  by applying  the well known Dijkstra shortest path algorithm
Adv:
Each router computes routes independently using the same original status data and do not depend on the computation of intermediate router
It is easy to debug the problems
The link status messages only carry information about the direct connections from a single router, so the size does not depend the number of networks   

0 comments: