UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is...

40
CS603 TCP/IP Technology Unit - IV MTech CSE (PT, 2011-14) SRM, Ramapuram 1 hcr:innovationcse@gg UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS Services flow, congestion and error control TCP package and operation state transition diagram unicast routing protocols RIP OSPF BGP multicast routing trees protocols MOSPF CBT PIM TCP/IP PROTOCOL SUITE TCP SERVICES Process-to-Process Communication Stream Delivery Service Full-Duplex Communication Multiplexing and Demultiplexing Connection-Oriented Service Reliable Service Process-to-Process Communication process-to-process communication using port numbers Well-known Ports used by TCP Port Protocol Description 7 Echo Echoes a received datagram back to the sender 9 Discard Discards any datagram that is received 11 Users Active users 13 Daytime Returns the date and the time 17 Quote Returns a quote of the day 19 Chargen Returns a string of characters 20, 21 FTP File Transfer Protocol (Data and Control) 23 TELNET Terminal Network 25 SMTP Simple Mail Transfer Protocol 53 DNS Domain Name Server 67 BOOTP Bootstrap Protocol 79 Finger Finger 80 HTTP Hypertext Transfer Protocol

Transcript of UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is...

Page 1: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 1 hcr:innovationcse@gg

UNIT – IV TCP, UNICAST AND MULTICAST

ROUTING PROTOCOLS Services – flow, congestion and error control – TCP package and operation – state transition diagram – unicast

routing protocols – RIP – OSPF – BGP – multicast routing – trees – protocols – MOSPF – CBT – PIM

TCP/IP PROTOCOL SUITE

TCP SERVICES Process-to-Process Communication

Stream Delivery Service

Full-Duplex Communication

Multiplexing and Demultiplexing

Connection-Oriented Service

Reliable Service

Process-to-Process Communication

process-to-process communication using port numbers

Well-known Ports used by TCP

Port Protocol Description

7 Echo Echoes a received datagram back to the sender

9 Discard Discards any datagram that is received

11 Users Active users

13 Daytime Returns the date and the time

17 Quote Returns a quote of the day

19 Chargen Returns a string of characters

20, 21 FTP File Transfer Protocol (Data and Control)

23 TELNET Terminal Network

25 SMTP Simple Mail Transfer Protocol

53 DNS Domain Name Server

67 BOOTP Bootstrap Protocol

79 Finger Finger

80 HTTP Hypertext Transfer Protocol

Page 2: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 2 hcr:innovationcse@gg

Stream Delivery Service

UDP (Just for comparison)

o a process sends messages with predefined boundaries to UDP for delivery.

o UDP adds its own header to each of these messages and delivers it to IP for transmission.

o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram.

o Neither IP nor UDP recognizes any relationship between the datagrams.

TCP

o TCP is a stream-oriented protocol.

o allows the sending process to deliver data as a stream of bytes and allows the receiving process to

obtain data as a stream of bytes.

o TCP creates an environment in which the two processes seem to be connected by an imaginary “tube”

that carries their bytes across the Internet.

o The sending process produces (writes to) the stream of bytes and the receiving process consumes

(reads from) them.

Stream delivery

Sending and Receiving Buffers

Because the sending and the receiving processes may not necessarily write or read data at the same rate,

TCP needs buffers for storage.

There are two buffers, the sending buffer and the receiving buffer, one for each direction

One way to implement a buffer is to use a circular array of varying locations

normally the buffers are hundreds or thousands of bytes

TCP Segments

At the transport layer, TCP groups a number of bytes together into a packet called a segment.

TCP adds a header to each segment (for control purposes) and delivers the segment to the IP layer for

transmission.

The segments are encapsulated in an IP datagram and transmitted.

This entire operation is transparent to the receiving process

(Use the above diagram and replace Stream of bytes with this)

Page 3: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 3 hcr:innovationcse@gg

Full-Duplex Communication

data can flow in both directions at the same time.

Each TCP endpoint then has its own sending and receiving buffer, and segments move in both directions

Multiplexing and Demultiplexing

TCP performs multiplexing at the sender and demultiplexing at the receiver.

Because of connection-oriented protocol, a connection needs to be established for each pair of processes.

Connection-Oriented Service

when a process at site A wants to send to and receive data from another process at site B,

the following three phases occur:

o 1. The two TCPs establish a virtual connection between them.

o 2. Data are exchanged in both directions.

o 3. The connection is terminated.

this is a virtual connection, not a physical connection.

segment is encapsulated in an IP datagram, can be sent out of order, or lost, or corrupted, and then resent.

Each may be routed over a different path to reach the destination.

There is no physical connection.

TCP creates a stream-oriented environment, accepts the responsibility of delivering the bytes in order

Reliable Service

TCP is a reliable transport protocol.

It uses an acknowledgment mechanism to check the safe and sound arrival of data.

TCP FEATURES Numbering System

Flow Control

Error Control

Congestion Control

Numbering System

Byte Number

o The bytes of data being transferred in each connection are numbered by TCP.

o The numbering starts with an arbitrarily generated number

Sequence Number

o TCP assigns a sequence number to each segment that is being sent.

o The value in the sequence number field of a segment defines the number assigned to the first data byte

contained in that segment.

o Example

Segment 1→ Sequence Number: 10,001 Range: 10,001 to 11,000

Segment 2→ Sequence Number: 11,001 Range: 11,001 to 12,000

Acknowledgment Number

o The value of the acknowledgment field in a segment defines the number of the next byte a party

expects to receive.

o The acknowledgment number is cumulative.

Flow Control

TCP provides flow control.

The sending TCP controls how much data can be accepted from the sending process; the receiving TCP

controls how much data can to be sent by the sending TCP

This is done to prevent the receiver from being overwhelmed with data.

The numbering system allows TCP to use a byte oriented flow control,

Page 4: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 4 hcr:innovationcse@gg

Error Control

To provide reliable service, TCP implements an error control mechanism.

Although error control considers a segment as the unit of data for error detection (loss or corrupted

segments), error control is byte-oriented

Congestion Control

TCP, unlike UDP, takes into account congestion in the network.

The amount of data sent by a sender is not only controlled by the receiver (flow control), but is also

determined by the level of congestion, if any, in the network.

SEGMENT (PACKET IN TCP) TCP segment format

Encapsulation

TCP segment format

Source port address

o port number of the application program in the host that is sending the segment

Destination port address

o port number of the application program in the host that is receiving the segment

Sequence number

o number assigned to the first byte of data contained in this segment

o The sequence number tells the destination which byte in this sequence is the first byte in the segment.

o During connection establishment each party uses a random number generator to create an initial

sequence number (ISN), which is usually different in each direction

Acknowledgment number

o byte number that the receiver of the segment is expecting to receive from the other party.

Header length.

o This 4-bit field indicates the number of 4-byte words in the TCP header

o the value of this field is always between 5 (5 × 4= 20) and 15 (15× 4= 60)

Control

o This field defines 6 different control bits or flags

Page 5: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 5 hcr:innovationcse@gg

o These bits enable flow control, connection establishment and termination, connection abortion, and the

mode of data transfer in TCP

Window size

o window size of the sending TCP in bytes.

o normally referred to as the receiving window (rwnd) and is determined by the receiver.

o The sender must obey the dictation of the receiver in this case.

Checksum

o use of the checksum for TCP is mandatory

o includes psuedo header

Urgent pointer

o valid only if the urgent flag is set,

o is used when the segment contains urgent data

o It defines a value that must be added to the sequence number to obtain the number of the last urgent

byte in the data section of the segment

Options

o There can be up to 40 bytes of optional information in the TCP header

Encapsulation

Page 6: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 6 hcr:innovationcse@gg

TCP CONNECTION TCP is connection-oriented.

A connection-oriented transport protocol establishes a virtual path between the source and destination.

All of the segments belonging to a message are then sent over this virtual path.

A connection-oriented transmission requires three phases:

o Connection Establishment

o Data Transfer

o Connection Termination

Connection Reset

Connection Establishment

Three-Way Handshaking

The connection establishment in TCP is called three-way handshaking

The server program tells its TCP that it is ready to accept a connection.

This request is called a passive open.

A SYN segment cannot carry data, but it consumes one sequence number

A SYN + ACK segment cannot carry data, but does consume one sequence number

An ACK segment, if carrying no data, consumes no sequence number

Problems

o Simultaneous Open

o SYN flooding attack

denial of service attack

Data Transfer

after a connection is established, the client sends 2,000 bytes of data in two segments.

The server then sends 2,000 bytes in one segment.

The client sends one more segment.

The first three segments carry both data and acknowledgment, but the last segment carries only an

acknowledgment because there is no more data to be sent.

The data segments sent by the client have the PSH (push) flag set so that the server TCP tries to deliver

data to the server process as soon as they are received.

Pushing Data

o sending TCP must not wait for the window to be filled. It must create a segment and send it immediately

Urgent Data

o occasions in which an application program needs to send urgent bytes, some bytes that need to be

treated in a special way by the application at the other end

o The sending TCP creates a segment and inserts the urgent data at the beginning of the segment

Page 7: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 7 hcr:innovationcse@gg

Connection Termination

Three-Way Handshaking

usually initiated by the client

The FIN segment consumes one sequence number if it does not carry data

Half-Close

o one end can stop sending data while still receiving data.

o Either the server or the client can issue a half-close request.

o It can occur when the server needs all the data before processing can begin.

o A good example is sorting.

Page 8: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 8 hcr:innovationcse@gg

Connection Reset.

TCP at one end may deny a connection request, may abort an existing connection, or may terminate an idle

connection.

All of these are done with the RST (reset) flag.

Denying a Connection

o Suppose the TCP on one side has requested a connection to a nonexistent port.

o The TCP on the other side may send a segment with its RST bit set to deny the request.

Aborting a Connection

o One TCP may want to abort an existing connection due to an abnormal situation.

o It can send an RST segment to close the connection.

Terminating an Idle Connection

o The TCP on one side may discover that the TCP on the other side has been idle for a long time.

o It may send an RST segment to end the connection.

WINDOWS IN TCP TCP uses two windows (send window and receive window) for each direction of data transfer, which means

four windows for a bidirectional communication.

Send Window

send window size is dictated by the receiver (flow control) and the congestion in the underlying network

(congestion control)

similar to one used with the Selective Repeat protocol but with some differences

o variables that control the window are expressed in bytes

o sending segments of data as soon as it receives them from its process

o uses only one timer

Receive Window

rwnd = buffer size − number of waiting bytes to be pulled

Page 9: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 9 hcr:innovationcse@gg

FLOW CONTROL Flow control regulates the amount of data a source can send before receiving an acknowledgment from the

destination.

balances the rate a producer creates data with the rate a consumer can use the data.

TCP separates flow control from error control.

TCP defines a window that is imposed on the buffer of data delivered from the application program

Sliding Window Protocol

Silly Window Syndrome

Data flow and flow control feedbacks in TCP

Opening and Closing Windows

To achieve flow control, TCP forces the sender and the receiver to adjust their window sizes, although the

size of the buffer for both parties is fixed when the connection is established.

The receive window closes (moves its left wall to the right) when more bytes arrive from the sender;

it opens (moves its right wal l to the right) when more bytes are pulled by the process.

The opening, closing, and shrinking of the send window is controlled by the receiver.

The send window closes (moves its left wall to the right) when a new acknowledgement allows it to do so.

The send window opens (its right wall moves to the right) when the receive window size (rwnd) advertised

by the receiver allows it to do so.

Page 10: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 10 hcr:innovationcse@gg

An example of flow control

Shrinking of Windows

the receive window cannot shrink.

But the send window can shrink if the receiver defines a value for rwnd that results in shrinking the window

o new ackNo + new rwnd ≥ last ackNo + last rwnd

The left side of the inequality represents the new position of the right wall with respect to the sequence

number space;

the right side shows the old position of the right wall.

The relationship shows that the right wall should not move to the left.

The inequality is a mandate for the receiver to check its advertisment.

However, note that the inequality is valid only if Sf < Sn; we need to remember that all calculations are in

modulo 232

.

Window Shutdown

the receiver can temporarily shut down the window by sending a rwnd of 0.

This can happen if for some reason the receiver does not want to receive any data from the sender for a

while

In this case, the sender does not actually shrink the size of the window, but stops sending data until a new

advertisement has arrived

Probing: the sender can always send a segment with 1 byte of data. is used to prevent a deadlock

Note: We assume only unidirectional communication from client to server.

Therefore, only one window at each side is shown.

Page 11: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 11 hcr:innovationcse@gg

Silly Window Syndrome

A serious problem can arise in the sliding window operation when either the sending application program

creates data slowly or the receiving application program consumes data slowly, or both.

Any of these situations results in the sending of data in very small segments, which reduces the efficiency

of the operation.

For example, if TCP sends segments containing only 1 byte of data, it means that a 41-byte datagram (20

bytes of TCP header and 20 bytes of IP header) transfers only 1 byte of user data.

Here the overhead is 41/1, which indicates that we are using the capacity of the network very inefficiently.

The inefficiency is even worse after accounting for the data link layer and physical layer overhead.

This problem is called the silly window syndrome

Syndrome Created by the Sender

serving an application program that creates data slowly, for example, 1 byte at a time.

Nagle’s Algorithm

1. The sending TCP sends the first piece of data it receives from the sending application program even if it

is only 1 byte.

2. waits until either the receiving TCP sends an acknowledgment or until enough data has accumulated to

fill a maximum-size segment

3. Step 2 is repeated for the rest of the transmission

Syndrome Created by the Receiver

serving an application

program that consumes data slowly, for example, 1 byte at a time

Example: sending application program creates data in blocks of 1 kilobyte, but the receiving application

program consumes data 1 byte at a time.

Clark’s Solution

send an acknowledgment as soon as the data arrive, but to announce a window size of zero until

either there is enough space to accommodate a segment of maximum size

or until at least half of the receive buffer is empty

Delayed Acknowledgment

when a segment arrives, it is not acknowledged immediately.

The receiver waits until there is a decent amount of space in its incoming buffer before acknowledging the

arrived segments., reduces traffic

ERROR CONTROL TCP detects corrupted, lost, out-of-order, and duplicated segments.

Error control in TCP is achieved through the use of the checksum, acknowledgment, and time-out.

Checksum

Each segment includes a checksum field, which is used to check for a corrupted segment.

If a segment is corrupted as deleted by an invalid checksum, the segment is discarded by the destination

TCP and is considered as lost.

TCP uses a 16-bit checksum that is mandatory in every segment

Acknowledgment

TCP uses acknowledgments to confirm the receipt of data segments

ACK segments are never acknowledged

ACK segments do not consume sequence numbers and are not acknowledged

Common rules that define when receiver generate acknowledgments

1. When end A sends a data segment to end B, it must include (piggyback) an acknowledgment that gives

the next sequence number it expects to receive

2. receiver needs to delay sending an ACK (500ms) if there is only one outstanding in-order segment

Page 12: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 12 hcr:innovationcse@gg

3. there should not be more than two in-order unacknowledged segments at any time.

4. When a segment arrives with an out-of-order sequence number that is higher than expected, the

receiver immediately sends an ACK segment announcing the sequence number of the next expected

segment. This leads to the fast retransmission

5. When a missing segment arrives

6. If a duplicate segment arrives, the receiver discards the segment, but immediately sends an

acknowledgment indicating the next in-order segment expected

Acknowledgment Types

o Cumulative Acknowledgment (ACK)

o Selective Acknowledgment (SACK)

Retransmission

The heart of the error control mechanism is the retransmission of segments.

When a segment is sent, it is stored in a queue until it is acknowledged.

When the retransmission timer expires or when the sender receives three duplicate ACKs for the first

segment in the queue, that segment is retransmitted

o Retransmission after Retransmit Time Out (RTO)

o Retransmission after Three Duplicate ACK Segments

Out-of-Order Segments

Data may arrive out of order and be temporarily stored by the receiving TCP, but TCP guarantees that no out-

of-order data are delivered to the process

Scenarios

Lost Segment

Fast Retransmission

Delayed Segment

Duplicate Segment

Automatically Corrected Lost ACK

Lost Acknowledgment Corrected by Resending a Segment

Deadlock Created by Lost Acknowledgment

Lost Segment

The receiver TCP delivers only ordered data to the process

The receiver receives segment 4, which is out of order.

The receiver stores the data in the segment in its buffer but leaves a gap to indicate that there is no

continuity in the data.

The receiver immediately sends an acknowledgment to the sender displaying the next byte it expects

Page 13: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 13 hcr:innovationcse@gg

Fast Retransmission

Delayed Segment

TCP uses the services of IP, which is a connectionless protocol.

Each IP datagram encapsulating a TCP segment may reach the final destination through a different route

with a different delay.

Hence TCP segments may be delayed.

Delayed segments sometimes may time out.

If the delayed segment arrives after it has been resent, it is considered a duplicate segment and discarded

Duplicate Segment

A duplicate segment can be created, for example, by a sending TCP when a segment is delayed and

treated as lost by the receiver.

Handling the duplicated segment is a simple process for the destination TCP.

The destination TCP expects a continuous stream of bytes.

When a segment arrives that contains a sequence number equal to an already received and stored

segment, it is discarded.

An ACK is sent with ackNo defining the expected segment.

Automatically Corrected Lost ACK

Lost Acknowledgment Corrected by Resending a Segment

Deadlock Created by Lost Acknowledgment

Page 14: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 14 hcr:innovationcse@gg

receiver sends an acknowledgment with rwnd set to 0 and requests that the sender shut down its window

temporarily.

After a while, the receiver wants to remove the restriction; however, if it has no data to send, it sends an

ACK segment and removes the restriction with a nonzero value for rwnd.

A problem arises if this acknowledgment is lost.

The sender is waiting for an acknowledgment that announces the nonzero rwnd.

The receiver thinks that the sender has received this and is waiting for data.

This situation is called a deadlock

CONGESTION CONTROL Congestion control in TCP is based on both open-loop and closed-loop mechanisms.

TCP uses a congestion window and a congestion policy that avoid congestion and detect and alleviate

congestion after it has occurred

Congestion Window

If the network cannot deliver the data as fast as it is created by the sender, it must tell the sender to slow

down

In other words, in addition to the receiver, the network is a second entity that determines the size of the

sender’s window

Actual window size = minimum (rwnd, cwnd)

Congestion Policy

TCP’s general policy for handling congestion is based on three phases:

o slow start,

o congestion avoidance

o congestion detection

In the slow start phase, the sender starts with a slow rate of transmission, but increases the rate rapidly to

reach a threshold.

When the threshold is reached, the rate of increase is reduced.

Finally if ever congestion is detected, the sender goes back to the slow start or congestion avoidance

phase, based on how the congestion is detected

Slow Start: Exponential Increase

In the slow start algorithm, the size of the congestion window increases exponentially until it reaches a

threshold

Page 15: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 15 hcr:innovationcse@gg

Congestion Avoidance: Additive Increase

In the congestion avoidance algorithm the size of the congestion window increases additively until congestion is

detected.

Congestion Detection: Multiplicative Decrease

If congestion occurs, the congestion window size must be decreased.

The only way a sender can guess that congestion has occurred is the need to retransmit a segment

retransmission can occur in one of two cases:

o when the RTO timer times out or

o when three duplicate ACKs are received.

In both cases, the size of the threshold is dropped to half (multiplicative decrease)

Summary

Page 16: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 16 hcr:innovationcse@gg

TCP PACKAGE

The package involves

tables called transmission control blocks,

a set of timers

three software modules:

o a main module,

o an input processing module

o an output processing module

Transmission Control Blocks (TCB)

TCP is a connection-oriented transport protocol.

A connection may be open for a long period of time.

To control the connection, TCP uses a structure to hold information about each connection.

This is called a transmission control block (TCB).

Because at any time there can be several connections, TCP keeps an array of TCBs in the form of a table.

TCB Information

State

o This field defines the state of the connection according to the state transition diagram

Process

o This field defines the process using the connection and this machine as a client console

Local IP address

The local number

Remote IP address

Remote port number

Interface

Local Window

o This holds information about the info at local TCP

Remote Window

The Sending Sequence Number

Page 17: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 17 hcr:innovationcse@gg

The Receiving Sequence Number

Sending ACK numbe

Round trip time

Timeout values

Buffer size

Buffer pointer

TCP Timers

Retransmission Timer

o Round-Trip Time (RTT)

Measured RTT

Smoothed RTT

RTT Deviation

o Retransmission Time-out (RTO)

Persistence Timer

Keepalive Timer

TIME-WAIT Timer

Main Module

The main module is invoked by the arriving TCP segment, the timeout event or messages from the

application program.

TCP in the established state data or acknowledge segment arrives.

The input processing module is called to handle the sitation.

When the TCP is in the send data message is issued by application program called output processing

module.

Input Processing Module

The input processing model handles all the details needed to process data or acknowledgement received

when the TCP is in the established state.

This module sends ACK if needed. Takes care of window size announcement, does error checking …

Output processing module

Handles all the details needed to send out data received from application program when TCP in established

state.

It handles retransmission timeouts and persistent timeouts.

Main Module

TCP_Main_Module (Segment) { Search the TCB Table if (corresponding TCB is not found) Create a TCB with the state CLOSED Find the state of the entry in the TCB table Switch (state) { case CLOSED state: if (“passive open” message received) go to LISTEN state. if (“active open” message received) { send a SYN segment go to SYN-SENT state } if (any segment received)

Page 18: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 18 hcr:innovationcse@gg

send an RST segment if (any other message received) issue an error message break case LISTN state: if (“send data” message received) { Send a SYN segment Go to SYN-SENT state } if (any SYN segment received) { Send a SYN + ACK segment Go to SYN-RCVD state } if (any other segment or message received) Issue an error message break case SYN-SENT state: if (time-out) Go to CLOSED state if (SYN segment received) { Send a SYN + ACK segment Go to SYN-RCVD state } if (SYN + ACK segment received) { Send an ACK segment Go to ESTABLISHED state } if (any other segment or message received) Issue an error message break case SYN-RCVD state: if (an ACK segment received) Go to ESTABLISHID state if (time-out) { Send an RTS segment Go to CLOSED state } if (“close” message received) { Send a FIN segment Go to FIN-WAIT-I state } if (RTS segment received) Go to LISTEN state if (any other segment or message received) Issue an error message break case ESTABLISHED state: if (a FIN segment received) {

Page 19: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 19 hcr:innovationcse@gg

Send an ACK segment Go to CLOSED-WAIT state } if ("close" message received) { Send a FIN segment Go to FIN-WAIT-I } if (a RTS or an SYN segment received) Issue an error message if (data or ACK segment received) call the input module if ("send" message received) call the output module break case FIN-WAIT-1 state: if (a FIN segment received) { Send an ACK segment Go to CLOSING state } if (a FIN + ACK segment received) { Send an ACK segment Go to FIN-WAIT state } if (an ACK segment received) Go to FIN-WAIT-2 state if (any other segment or message received) Issue an error message break case FIN-WAIT-2 state: if (a FIN segment received) { Send an ACK segment Go to TIME-WAIT state } break case CLOSING state: if (an ACK segment received) Go to TIME-WAIT state if (any other message or segment received) Issue an error message break case TIME-WAIT state: if (time-out) Go to CLOSED state if (any other message or segment received) Issue an error message break case CLOSED-WAIT state: if ("close" message received) { Send a FIN segment Go to LAST-ACK state

Page 20: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 20 hcr:innovationcse@gg

} if (any other message or segment received) Issue an error message break case LAST-ACK state: if (an ACK segment received) Go to CLOSED state if (any other message or segment received) Issue an error message break } } // end module

STATE TRANSITION DIAGRAM To keep track of all the different events happening during connection establishment, connection

termination, and data transfer, TCP is specified as the finite state machine (FSM)

Each line has two strings separated by a slash.

o The first string is the input, what TCP receives.

o The second is the output, what TCP sends

The state marked as ESTBLISHED in the FSM is in fact two different sets of states that the client and

server undergo to transfer data.

Scenarios

Connection Establishment and Half-Close Termination

Connection Termination

Simultaneous Open

Simultaneous close

Denying a Connection

Aborting a Connection

States for TCP

Page 21: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 21 hcr:innovationcse@gg

State Description

CLOSED No connection exists

LISTEN Passive open received; waiting for SYN

SYN-SENT SYN sent; waiting for ACK

SYN-RCVD SYN+ACK sent; waiting for ACK

ESTABLISHED Connection established; data transfer in progress

FIN-WAIT-1 First FIN sent; waiting for ACK

FIN-WAIT-2 ACK to first FIN received; waiting for second FIN

CLOSE-WAIT First FIN received, ACK sent; waiting for application to close

TIME-WAIT Second FIN received, ACK sent; waiting for 2MSL time-out

LAST-ACK Second FIN sent; waiting for ACK

CLOSING Both sides decided to close simultaneously

Connection Establishment and Half-Close Termination

Page 22: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 22 hcr:innovationcse@gg

Connection Termination

Simultaneous Open

Page 23: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 23 hcr:innovationcse@gg

Simultaneous close

Denying a Connection

Aborting a Connection

Page 24: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 24 hcr:innovationcse@gg

UNICAST ROUTING PROTOCOLS Routing inside an autonomous system is referred to as intradomain routing.

Routing between autonomous systems is referred to as interdomain routing.

RIP

Distance Vector Routing

Bellman-Ford algorithm

o Static routing like roads

Distance Vector Routing Algorithm

o Suitable for autonomous systems

o cost between any two neighbors is set to 1.

o Each router needs to update its routing table asynchronously

In distance vector routing, the least cost route between any two nodes is the route with minimum distance.

In this protocol each node maintains a vector (table) of minimum distances to every node

Each node shares its routing table with its immediate neighbors periodically and when there is a change

Count to Infinity

o A problem with distance vector routing is that any decrease in cost (good news) propagates quickly, but

any increase in cost (bad news) propagates slowly

o It takes several updates before the cost for a broken link is recorded as infinity by all routers

o Two-Node Loop

One example of count to infinity is the two-node loop problem

Solutions

Defining Infinity

Split Horizon

Split Horizon and Poison Reverse

o Three-Node Instability

if the instability is between three nodes, stability cannot be guaranteed

Routing Information Protocol (RIP)

an intradomain (interior) routing protocol used inside an autonomous system.

It is a very simple protocol based on distance vector routing.

RIP implements distance vector routing directly with some considerations:

1. In an AS, we are dealing with routers and networks (links), what was described as a node.

2. The destination in a routing table is a network, which means the first column defines a network address.

3. The metric used by RIP is very simple; the distance is defined as the number of links (networks) that

have to be used to reach the destination.

For this reason, the metric in RIP is called a hop count.

4. Infinity is defined as 16, which means that any route in an autonomous system using RIP cannot have

more than 15 hops.

5. The next node column defines the address of the router to which the packet is to be sent to reach its

destination.

Page 25: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 25 hcr:innovationcse@gg

Example of a domain using RIP

RIP Message Format

Command

o This 8-bit field specifies the type of message: request (1) or response (2).

Version

o This 8-bit field defines the version (1 or 2)

Family

o This 16-bit field defines the family of the protocol used.

o For TCP/IP the value is 2.

Network address

o The address field defines the address of the destination network.

o RIP has allocated 14 bytes for this field to be applicable to any protocol.

o However, IP currently uses only 4 bytes. The rest of the address is filled with 0s.

Distance

o This 32-bit field defines the hop count (cost) from the advertising router to the destination network.

Page 26: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 26 hcr:innovationcse@gg

Requests and Responses

Timers in RIP

Encapsulation

RIP uses the services of UDP on well-known port 520.

RIP messages are encapsulated in UDP user datagrams.

A RIP message does not include a field that indicates the length of the message.

This can be determined from the UDP packet.

The well-known port assigned to RIP in UDP is port 52

OSPF

Link State Routing

Dijkstra algorithm to build a routing table

Page 27: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 27 hcr:innovationcse@gg

Building Routing Tables

1. Creation of the states of the links by each node, called the link state packet or LSP.

2. Dissemination of LSPs to every other router, called flooding, in an efficient and reliable way.

3. Formation of a shortest path tree for each node.

4. Calculation of a routing table based on the shortest path tree

Open Shortest Path First (OSPF) protocol

intradomain routing protocol based on link state routing

Areas

o collection of networks, hosts, and routers all contained within an autonomous system

o area border routers – backbone - backbone routers - virtual link

Metric

o can be based on a type of service (minimum delay, maximum throughput, and so on).

Types of Links

Four types of links have been defined:

o point-to-point,

o transient,

o stub

o virtual

Example of an AS and its graphical representation in OSPF

Page 28: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 28 hcr:innovationcse@gg

Types of OSPF packets

OSPF common header

Link State Update Packet

used by a router to advertise the states of its links.

Each update packet may contain several different LSAs

LSA general header

Link state age

o the number of seconds elapsed since this message was first generated.

o When a router creates the message, the value of this field is 0.

o When each successive router forwards this message, it estimates the transit time and adds it to the

cumulative value of this field.

E flag

o If this 1-bit flag is set to 1, it means that the area is a stub area. A stub area is an area that is connected

to the backbone area by only one path.

T flag

o If this 1-bit flag is set to 1, it means that the router can handle multiple types of service.

Page 29: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 29 hcr:innovationcse@gg

Link state type

o This field defines the LSA type

o five different advertisement types:

router link (1),

network link (2),

summary link to network (3),

summary link to AS boundary router (4)

external link (5).

Link state ID

o The value of this field depends on the type of link.

o For type 1 (router link), it is the IP address of the router.

o For type 2 (network link), it is the IP address of the designated router.

o For type 3 (summary link to network), it is the address of the network.

o For type 4 (summary link to AS boundary router), it is the IP address of the AS boundary router.

o For type 5 (external link), it is the address of the external network.

Advertising router

o This is the IP address of the router advertising this message.

Link state sequence number

o This is a sequence number assigned to each link state update message.

Link state checksum

o calculated using Fletcher’s checksum, which is based on the whole packet except for the age field.

Length

o This defines the length of the whole packet in bytes.

Packets used in Link State Update

Router Link LSA

Network Link LSA

Summary link to network LSA

Summary Link to AS Boundary Router LSA

External Link LSA

Router Link LSA

Network Link LSA

Page 30: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 30 hcr:innovationcse@gg

Summary link to network LSA

Summary Link to AS Boundary Router LSA

External Link LSA

Other Packets in OSPF

Hello Message

Database Description Message

Link State Request Packet

Link State Acknowledgment Packet

Hello Message

Page 31: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 31 hcr:innovationcse@gg

Database Description Message

Link State Request Packet

Link State Acknowledgment Packet

Encapsulation

OSPF packets are encapsulated in IP datagrams.

BORDER GATEWAY PROTOCOL (BGP)

Path Vector Routing (or) inter-AS routing

a router has a list of networks that can be reached with the path (list of ASs to pass) to reach each one

the domain of operation is the whole Internet.

the path vector routing tells us the path

Comparison with Distance Vector Routing

a router has a list of networks that can be reached in the same AS with its cost (number of hops).

the domain of is a single AS;

tells us the distance to each network

Path Vector Routing

Reachability

To be able to provide information to other ASs, each AS must have at least one path vector routing that collects

reachability information about each network in that AS

Routing Tables

Loop Prevention

Aggregation

Policy Routing

Page 32: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 32 hcr:innovationcse@gg

BGP

interdomain routing protocol using path vector routing.

Types of Autonomous Systems

Internet is divided into hierarchical domains called autonomous systems (ASs)

Stub AS

has only one connection to another AS.

The interdomain data traffic in a stub AS can be either created or terminated in the AS.

Data traffic, however, cannot pass through a stub AS.

A stub AS is either a source or a sink.

A good example of a stub AS is a small corporation or a small local ISP

Multihomed AS

has more than one connection to other ASs, but it is still only a source or sink for data traffic.

there is no transient traffic

A good example of a multihomed AS is a large corporation that is connected to more than one regional or

national AS that does not allow transient traffic.

Transit AS

A transit AS is a multihomed AS that also allows transient traffic.

Good examples of transit ASs are national and international ISPs (Internet backbones).

CIDR

BGP uses Classless Interdomain Routing Addresses

BGP uses a prefix, to define a destination address.

The address and the number of bits (prefix length) are used in updating messages.

Path Attributes

presented as a list of autonomous systems, a list of attributes

Each attribute gives some information about the path.

The list of attributes helps the receiving router make a better decision when applying its policy.

Attributes are divided into two broad categories:

o well-known

A wellknown attribute is one that every BGP router must recognize

Well-known attributes are divided into two categories:

mandatory

o A well-known mandatory attribute is one that must appear in the description of a route.

o Examples

ORIGIN : defines the source of the routing information (RIP, OSPF, and so on)

AS_PATH: defines the list of autonomous systems through which the destination can

be reached.

NEXT-HOP: defines the next router to which the data packet should be sent

discretionary.

o A well-known discretionary attribute is one that must be recognized by each router, but is

not required to be included in every update message.

o optional

An optional attribute is one that needs not be recognized by every router.

subdivided into two categories:

transitive and

o An optional transitive attribute is one that must be passed to the next router by the router

that has not implemented this attribute.

nontransitive.

o An optional nontransitive attribute is one that must be discarded if the receiving router has

not implemented it.

Page 33: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 33 hcr:innovationcse@gg

BGP Sessions

A session is a connection that is established between two BGP routers only for the sake of exchanging

routing information

To create a reliable environment, BGP uses the services of TCP

When a TCP connection is created for BGP, it can last for a long time

Hence referred to as semipermanent connections

Two types of sessions

External BGP (E-BGP)

o used to exchange information between two speaker nodes belonging to two different AS

Internal BGP (I-BGP) sessions.

o used to exchange routing information between two routers inside an autonomous system.

Types of BGP messages

Open

Update

Keepalive

Notification

BGP Packet Header

Marker.

o The 16-byte marker field is reserved for authentication.

Length

o This 2-byte field defines the length of the total message including the header.

Type

o This 1-byte field defines the type of the packet.

o we have four types(open, update, keepalive, and notification), the values 1 to 4 define those types.

Page 34: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 34 hcr:innovationcse@gg

Open Message

Version: This 1-byte field defines the version of BGP. The current version is 4.

My autonomous system : This 2-byte field defines the autonomous system number.

Hold time : This 2-byte field defines the maximum number of seconds that can elapse until one of the

parties receives a keepalive or update message from the other.

BGP identifier: This 4-byte field defines the router that sends the open message.

Option length : this 1-byte field defines the length of the total option parameters

Option parameters : Each option parameter itself has two subfields:

o the length of the parameter

o the parameter value

The only option parameter defined so far is authentication.

Update Message

Unfeasible routes length. This 2-byte field defines the length of the next field.

Withdrawn routes. This field lists all the routes that must be deleted from the previously advertised list

Path attributes length. This 2-byte field defines the length of the next field.

Path attributes. This field defines the attributes of the path (route) to the network whose reachability is being

announced in this message.

Network layer reachability information (NLRI). This field defines the network that is actually advertised by

this message.

Page 35: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 35 hcr:innovationcse@gg

Keepalive Message

The routers running the BGP protocols exchange keepalive messages regularly (before their hold time expires)

to tell each other that they are alive

Notification Message

A notification message is sent by a router whenever an error condition is detected or a router wants to close the

connection

Encapsulation

BGP uses the services of TCP on port 179

Page 36: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 36 hcr:innovationcse@gg

MULTICAST ROUTING

Multicasting

one source and a group of destinations

one to many relationship

the source address is a unicast

address, but the destination address is

a group address

the router may forward the received

datagram through several of its

interfaces

Multicast Routing

A multicast packet may have destinations in more than one network.

Forwarding of a single packet to members of a group requires a shortest path tree.

If we have n groups, we may need n shortest path trees

each involved router needs to construct a shortest path tree for each group

Two approaches: source-based trees, group-shared trees

Source-Based Tree

each router needs to have one shortest path tree for each group

Group-Shared Tree

only the core router, which has a shortest path tree for each group, is involved in multicasting.

Page 37: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 37 hcr:innovationcse@gg

MULTICAST ROUTING PROTOCOLS Taxonomy of common multicast protocols

Multicast Link State Routing

Multicast link state routing is a direct extension of unicast routing and uses a source-based tree approach

A node advertises every group that has any loyal member on the link

When a router receives all these LSPs, it creates n (n is the number of groups) topologies, from which n

shortest path trees are made using Dijkstra’s algorithm

Create a routing table that represents as many shortest path trees as there are groups

time and space needed to create and save the many shortest path trees

o create the trees only when needed

Multicast Open Shortest Path First (MOSPF)

extension of the OSPF protocol that uses multicast link state routing to create source-based trees

group membership LSA

o new link state update packet to associate the unicast address of a host with the group address or

addresses the host is sponsoring

data-driven protocol

o the first time an MOSPF router sees a datagram with a given source and group address, the router

constructs the Dijkstra shortest path tree

Multicast Distance Vector Routing

uses source-based trees

router never actually makes a routing table.

o When a router receives a multicast packet, it forwards the packet as though it is consulting a routing

table.

o the shortest path tree is momentary

o After its use (after a packet is forwarded) the table is destroyed

Four decision-making strategies

o Flooding

o Reverse Path Forwarding (RPF)

o Reverse Path Broadcasting (RPB)

o Reverse Path Multicasting (RPM)

Flooding

the router sends the received packet out from every interface except the one from which it was received,

without even looking at the destination group address

every network with active members receives the packet

broadcasts packets, but creates loops in the systems

Reverse Path Forwarding (RPF)

a router forwards only the copy that has traveled the shortest path from the source to the router, it discards

it otherwise

uses the unicast routing table

eliminates the loop in the flooding process

Page 38: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 38 hcr:innovationcse@gg

Reverse Path Broadcasting (RPB)

only one parent router for each network

A network can receive a multicast packet from a particular source only through a designated parent router

the router sends the packet only out of those interfaces for which it is the designated parent

RPB creates a shortest path broadcast tree from the source to each destination.

It guarantees that each destination receives one and only one copy of the packet

Reverse Path Multicasting (RPM)

To increase efficiency, the multicast packet must reach only those networks that have active members for

that particular group

To convert broadcasting to multicasting, the protocol uses two procedures,

o pruning

o grafting

RPM adds pruning and grafting to RPB to create a multicast shortest path tree that supports dynamic

membership changes

Pruning

The designated parent router of each network is responsible for holding the membership information

The router sends a prune message to the upstream router so that it can prune the corresponding interface.

the upstream router can stop sending multicast messages for this group through that interface.

If this router receives prune messages from all downstream routers, it, in turn, sends a prune message to its

upstream router

Grafting

The graft message forces the upstream router to resume sending the multicast messages

o a leaf router that has sent a prune message, realizes that one of its networks is again interested in

receiving the multicast packet

Page 39: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 39 hcr:innovationcse@gg

Distance Vector Multicast Routing Protocol (DVMRP)

implementation of multicast distance vector routing.

It is a source-based routing protocol,

based on Routing Information Protocol (RIP)

Core-Based Tree (CBT) Protocol

Aa group-shared protocol that uses a core as the root of the tree.

The autonomous system is divided into regions

A core (center router or rendezvous router) is chosen for each region

Group-shared tree with rendezvous router

Next diagram without flow

Sending a multicast packet to the rendezvous router

Page 40: UNIT IV TCP, UNICAST AND MULTICAST ROUTING PROTOCOLS … · o Each message from the process is called a user datagram, and becomes, eventually, one IP datagram. o Neither IP nor UDP

CS603 TCP/IP Technology Unit - IV

MTech CSE (PT, 2011-14) SRM, Ramapuram 40 hcr:innovationcse@gg

Formation of the Tree

After the rendezvous point is selected, every router is informed of the unicast address of the selected router

Each router with an intercreated group then sends a unicast join message (similar to a grafting message) to

show that it wants to join the group.

This message passes through all routers that are located between the sender and the rendezvous router.

Each intermediate router extracts the necessary information from the message, such as the unicast

address of the sender and the interface through which the packet has arrived, and forwards the message to

the next router in the path.

When the rendezvous router has received all join messages from every member of the group, the tree is

formed.

Now every router knows its upstream router (the router that leads to the root) and the downstream router

(the router that leads to the leaf)

Sending Multicast Packets

sends the packet to the rendezvous router, using the unicast address of the rendezvous router;

the rendezvous router distributes the packet to all members of the group

The source sends the multicast packet (encapsulated in a unicast packet) to the core router.

The core router decapsulates the packet and forwards it to all interested interfaces

Protocol Independent Multicast (PIM)

Protocol Independent Multicast, Dense Mode (PIM-DM)

Protocol Independent Multicast, Sparse Mode (PIM-SM)

PIM-DM

PIM-DM is used in a dense multicast environment, such as a LAN.

PIM-DM uses RPF and pruning/grafting strategies to handle multicasting. However, it is independent from

the underlying unicast protocol

PIM-DM is a source-based tree routing protocol that uses RPF and pruning/grafting strategies for

multicasting

Its operation is like DVMRP; however, unlike DVMRP, it does not depend on a specific unicasting protocol.

It assumes that the autonomous system is using a unicast protocol and each router has a table that can find

the outgoing interface that has an optimal path to a destination.

This unicast protocol can be a distance vector protocol (RIP) or link state protocol (OSPF).

PIM-SM

Used in a sparse multicast environment such as a WAN

Group-shared tree routing protocol that has a rendezvous point (RP) as the source of the tree.

Like CBT; but simpler because it does not require acknowledgment from a join message

It creates a backup set of RPs for each region to cover RP failures.

Can switch from a group-shared tree strategy to a source-based tree strategy when necessary.

o Can happen if there is a dense area of activity far from the RP.

o It can be more efficiently handled with a source-based tree strategy

Comments & Feedback

Thanks to my family members who supported me while I spent long hours to prepare this.

Your feedback is always welcome at [email protected]