Computer Networks Modeling and Simulation

Download Report

Transcript Computer Networks Modeling and Simulation

Transport and Networks Layers
Transport and Networks
Layers
Dr. Hussein Al-Bahadili
Faculty of Information Technology
University of Petra
([email protected])
Network and Network Layers - Dr. Hussein Al-Bahadili
1/139
Topics Covered
•
•
•
TCP Services and Protocols
UDP Services and Protocols
IP Services and Protocols
Network and Network Layers - Dr. Hussein Al-Bahadili
2/139
Transmission Control Protocol (TCP)
•
•
•
Transmission Control Protocol (TCP) was specifically
designed to provide a reliable end-to-end byte stream
over an unreliable internetwork.
An internetwork differs from a single network because
different parts may have different topologies, delays,
bandwidths, packet sizes, and other parameters.
TCP was designed to dynamically adapt to properties of
the internetwork and to be robust in the face of many
kinds of failures.
Network and Network Layers - Dr. Hussein Al-Bahadili
3/139
Transmission Control Protocol (TCP)
•
•
•
Each machine supporting TCP has a TCP transport
entity, either a library procedure, a user process, or part
of the kernel.
In all cases, each machine manages TCP streams and
interfaces to the IP layer.
A TCP entity accepts user data streams from local
processes, breaks them up into pieces not exceeding
64 KB (often 1460 bytes in order to fit in a single
Ethernet frame with the IP and TCP headers), and
sends each piece as a separate IP datagram.
Network and Network Layers - Dr. Hussein Al-Bahadili
4/139
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Transmission Control Protocol (TCP)
•
•
•
•
When datagrams containing TCP data arrive at a
machine, they are given to the TCP entity, which
reconstructs the original byte streams.
The IP layer gives no guarantee that datagrams will be
delivered properly, so it is up to TCP to time out and
retransmit them as need be.
Datagrams that do arrive may well do so in the wrong
order; it is also up to TCP to reassemble them into
messages in the proper sequence.
In short, TCP must furnish the reliability that most users
want and that IP does not provide.
Network and Network Layers - Dr. Hussein Al-Bahadili
5/139
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The TCP Service Model
•
•
•
•
TCP service is obtained by both the sender and receiver creating
end points, called sockets.
Each socket has a socket number (address) consisting of the IP
address of the host and a 16-bit number local to that host, called a
port. A port is the TCP name for a TSAP.
For TCP service to be obtained, a connection must be explicitly
established between a socket on the sending machine and a
socket on the receiving machine.
A socket may be used for multiple connections at the same time.
Connections are identified by the socket identifiers at both ends,
that is (socket1, socket2).
Amman Arab University for Graduate Network
Studies – and
Graduate
College
of Computing
Studies
– Computer Networks Modeling and Simulation6
Network
Layers
- Dr. Hussein
Al-Bahadili
(Dr. Hussein Al-Bahadili – [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
TCP Services
•
TCP provides several services to its applications,
these services are:
1. Connection-Oriented Service
2. Streaming Service
3. Full-Duplex Service
4. Reliable Service
5. End-to-End Semantic
Amman Arab University for Graduate Network
Studies – and
Graduate
College
of Computing
Studies
– Computer Networks Modeling and Simulation7
Network
Layers
- Dr. Hussein
Al-Bahadili
(Dr. Hussein Al-Bahadili – [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The TCP Segment Header
•
•
•
Every TCP segment begins with a fixed-format 20-byte
header which may be followed by header options.
After these options, if any, up to 65,535 - 20 - 20 =
65,495 data bytes may follow, where the first 20 refer
to the IP header and the second 20 to the TCP header.
Segments without any data are legal and are
commonly used for acknowledgements and control
messages.
Amman Arab University for Graduate Network
Studies – and
Graduate
College
of Computing
Studies
– Computer Networks Modeling and Simulation8
Network
Layers
- Dr. Hussein
Al-Bahadili
(Dr. Hussein Al-Bahadili – [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Field Description of the TCP Segment Header
Field
Length
Description
Source Port
16-bit
Source end point of the connection
Destination Port
16-bit
Destination end point of the connection
Sequence
Number
32-bit
Last byte correctly received
Acknowledgement
32-bit
Number
The next byte expected.
TCP Header
Length
4-bit
Tells how many 32-bit words are contained
in the TCP header.
Future
Development
6-bit
Not Used yet.
9
Amman Arab University
for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network and Network Layers - Dr. Hussein Al-Bahadili
(Dr. Hussein Al-Bahadili – [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Field Description of the TCP Segment Header
Field
Length
URG
1-bit
Description
It sets to 1 if the Urgent pointer is in use. The Urgent pointer is
used to indicate a byte offset from the current sequence
number at which urgent data are to be found. This facility is
similar to interrupt messages. As we mentioned above, this
facility is a bare-bones way of allowing the sender to signal
the receiver without getting TCP itself involved in the reason
for the interrupt.
ACK
1-bit
It sets to 1 to indicate that the ACK number is valid. If ACK is
0, the segment does not contain an ACK so the ACK number
field is ignored.
PSH
1-bit
It indicates PUSHed data. The receiver is hereby kindly
requested to deliver the data to the application upon arrival
and not buffer it until a full buffer has been received (which it
might do for efficiency).
10
Amman Arab University
for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network and Network Layers - Dr. Hussein Al-Bahadili
(Dr. Hussein Al-Bahadili – [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Field Description of the TCP Segment Header
Field
Length
Description
RST
1-bit
It is used to reset a connection that has become confused
due to some reasons. It is also used to reject an invalid
segment or refuse an attempt to open a connection.
SYN
1-bit
It is used to establish connections. The connection request
has SYN = 1 and ACK = 0 to indicate that the piggyback ACK
field is not in use. The connection reply does bear an ACK, so
it has SYN = 1 and ACK = 1. In essence the SYN bit is used
to denote CONNECTION REQUEST and CONNECTION
ACCEPTED, with the ACK bit used to distinguish between
those two possibilities.
FIN
1-bit
It is used to release a connection. It specifies that the sender
has no more data to transmit. After closing a connection, the
closing process may continue to receive data indefinitely.
Both SYN and FIN segments have sequence numbers and
are guaranteed to be processed in the correct order.
11
Amman Arab University
for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network and Network Layers - Dr. Hussein Al-Bahadili
(Dr. Hussein Al-Bahadili – [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Field Description of the TCP Segment Header
Field
Length
Description
Window Size
16-bit
It tells how many bytes may be sent starting at
the byte acknowledged. A window size field of 0
is legal and says that the bytes up to and
including ACK number - 1 have been received,
but the receiver would like no more data for the
moment.
Checksum
16-bit
It is provided for extra reliability. It checksums
the header, the data, and the conceptual
pseudoheader.
Urgent Pointer
16-bit
Describe below
Options
32x-bit
Describe below
Data
32x-bit
Describe below
12
Amman Arab University
for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network and Network Layers - Dr. Hussein Al-Bahadili
(Dr. Hussein Al-Bahadili – [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The TCP Header.
Amman Arab University for Graduate Network
Studies – and
Graduate
College
of Computing
Studies
– Computer Networks Modeling and Simulation13
Network
Layers
- Dr. Hussein
Al-Bahadili
(Dr. Hussein Al-Bahadili – [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The TCP Segment Header (Checksum Computation)
•
•
•
When performing this computation, the TCP Checksum
field is set to zero and the data field is padded out with
an additional zero byte if its length is an odd number.
The checksum algorithm is simply to add up all the 16bit words in one's complement and then to take the
one's complement of the sum.
As a consequence, when the receiver performs the
calculation on the entire segment, including the
Checksum field, the result should be 0.
Amman Arab University for Graduate Network
Studies – and
Graduate
College
of Computing
Studies
– Computer Networks Modeling and Simulation14
Network
Layers
- Dr. Hussein
Al-Bahadili
(Dr. Hussein Al-Bahadili – [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The TCP Segment Header (Pseudoheader)
•
The pseudoheader contains:
(i) The 32-bit IP addresses of the source and destination
machines.
(ii) The protocol number for TCP (6).
(iii) The byte count for the TCP segment (including the header).
•
•
Including the pseudoheader in the TCP checksum
computation helps detect misdelivered packets, but
including it also violates the protocol hierarchy since
the IP addresses in it belong to the IP layer, not to the
TCP layer.
UDP uses the same pseudoheader for its checksum.
Amman Arab University for Graduate Network
Studies – and
Graduate
College
of Computing
Studies
– Computer Networks Modeling and Simulation15
Network
Layers
- Dr. Hussein
Al-Bahadili
(Dr. Hussein Al-Bahadili – [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The pseudoheader included in the TCP checksum.
Amman Arab University for Graduate Network
Studies – and
Graduate
College
of Computing
Studies
– Computer Networks Modeling and Simulation16
Network
Layers
- Dr. Hussein
Al-Bahadili
(Dr. Hussein Al-Bahadili – [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The TCP Segment Header (Options Field)
•
•
The Options field provides a way to add extra facilities
not covered by the regular header.
The most important options are:
1. Maximum TCP payload option which allows each host to
specify the maximum TCP payload it is willing to accept.
2. Window scale option which allows the sender and receiver to
negotiate a window scale factor.
3. Window type option which allows the use of selective repeat
instead of go back n protocol.
4. Timestamp which is used for more accurate round-trip time
(RTT) calculations. Two four-byte timestamp fields are used
for this option.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
17
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Encapsulation in IP
•
•
•
Once a TCP segment is ready for transmission, it
is passed on to the network layer.
The network layer encapsulates the entire TCP
segment, the TCP header, and the TCP payload
in to IP packet payload.
Given this encapsulation method, the first 20
bytes of the IP packet payload contain all fields
of a standard TCP header (no options used).
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
18
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Encapsulation of TCP segment into IP datagram
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
19
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Acknowledgment Mechanism
•
•
TCP relies on acknowledgments from the receiver to
confirm correct delivery of data.
Some of the important features of TCP’s ACK
mechanism are:
1. Cumulative Acknowledgement
2. ACK-Only Segment and Piggybacking
3. Delay ACK
4. Duplicate ACK
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
20
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
1. Cumulative Acknowledgement
•
•
Each ACK is a confirmation that all bytes up to the
ACK number has been received correctly.
One obvious benefit of such cumulative ACK is that
many lost ACKs are easily compensated for by the
subsequent ACK of higher numbers.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
21
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
2. ACK-Only Segment and Piggybacking
•
•
The ACK is indicated through an ACK field in the TCP
header.
To acknowledge correctly received bytes a receiver can:
 Either create an ACK-only segment (the segment
carries only the header containing the ACK number,
no data are sent in this segment).
 Or it can send the ACK in the data segment
(segment carrying data in the reverse direction),
which is called piggybacking.
•
Piggybacking reduces ACK traffic in reverse direction.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
22
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
3. Delayed ACK
•
•
•
•
The receiving TCP has the choice of either generating
an ACK as soon as it receives a segment or delaying the
ACK for a while.
By delaying the ACK, the receiver may be able to
acknowledge two segments at a time and reduce ACK
traffic.
Delaying an ACK for too long may cause timeout and
retransmission at the sender.
A TCP receiver should not delay ACKs more than 500
msec.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
23
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
4. Duplicate ACK
•
•
•
If a segment get lost in the network, and the following
segment arrives safely, then a TCP receives data with a
sequence number beyond the expected range.
In that case, the TCP buffers the incoming bytes and
regenerates the ACK for the bytes received so far in
sequence.
The regeneration of the same ACK number causes the
duplicate ACK phenomenon at the sender, i.e., the
sender receives the same more than once.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
24
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Retransmission Mechanism
•
•
•
•
Retransmission is the basic tenet of TCP’s reliable
data transfer service, if a segment is lost, it has to be
retransmitted.
To detect the loss of a segment, TCP maintains a
retransmission timer for each segment sent.
The timer is set for a duration called the retransmission
timeout (RTO) period.
If an ACK is received during the RTO, the timer is
cleared; otherwise the timer expires. On expiration of
the retransmission timer, the segment is retransmitted.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
25
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Retransmission Mechanism
•
•
Setting an optimum value for the RTO is very significant
from the performance point of view.
The timeout period should be greater than the round-trip
time (RTT) to accommodate various delays, such as




•
the transmission delay,
the link propagation delay,
the header processing time,
the ACK generation time, and so on.
In a dynamic environment, the actual RTT may vary
over time.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
26
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Longer RTO
Setting the RTO longer than necessary would result in
longer delay for application if losses are frequent.
Smaller RTO
Setting the RTO smaller than required may result in
premature retransmissions causing waste of
communication resources such as bandwidth and
processing time.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
27
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
• To address the problem of selecting an appropriate value
for the RTT, the TCP sender maintain an estimate of
RTT (EstimatedRTT) for each of its connections. It is
given by:
EstimatedRTT = (1 - a ) * EstimatedRTT + a * SampleRTT
• Where SampleRTT is defined as the time from the
moment a TCP segment is transmitted until ACK is
received for the segment.
• SampleRTT varies between measurements (the
variation is usually caused by the variable queuing
delays in intermediate routers).
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
28
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
•
•
TCP/IP
Fundamentals
A typical value used for a is 0.125.
The RTO is estimated by:
RTO = EstimatedRTT + 4 * Deviation
where
Deviation = (1–a) * Deviation + a |SampleRTT – EstimatedRTT|
•
•
Most TCP implementations represent the RTO as a
multiple of clocks ticks (typically 500 msec).
A retransmission timer should be set to at least 2 ticks
(1 sec)
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
29
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The Internet Transport Protocols: UDP
•
•
•
Introduction to UDP
Remote Procedure Call
The Real-Time Transport Protocol
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
30
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Introduction to UDP
•
•
•
•
•
The Internet protocol suite supports a connectionless
transport protocol, UDP (User Datagram Protocol).
UDP provides a way for applications to send
encapsulated IP datagrams and send them without
having to establish a connection.
UDP transmits segments consisting of an 8-byte header
followed by the payload.
The source and destination ports serve to identify the
end points within the source and destination machines.
When a UDP packet arrives, its payload is handed to the
process attached to the destination port.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
31
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The UDP header.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
32
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Fields of the UDP Header
•
•
•
•
The source port is primarily needed when a reply must
be sent back to the source. By copying the source port
field from the incoming segment into the destination
port field of the outgoing segment, the process sending
the reply can specify which process on the sending
machine is to get it.
The UDP length field includes the 8-byte header and
the data.
The UDP checksum is optional and stored as 0 if not
computed (a true computed 0 is stored as all 1s).
Turning the UDP checksum off if the quality of the data
does not matter (e.g., digitized speech).
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
33
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
What UDP Does not Do
- Flow control.
- Error control.
- Retransmission upon receipt of a bad segment.
What UDP does do
- Provide an interface to the IP protocol with the
added feature of demultiplexing multiple processes
using the ports.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
34
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
UDP Application
•
•
•
UDP is useful in client-server situations, in which the
client sends a short request to the server and expects
a short reply back. If either the request or reply is lost,
the client can just time out and try again.
An application that uses UDP is the Domain Name
System (DNS). The DNS is a program that needs to
look up the IP address of some host name.
For example, www.cs.berkeley.edu, can send a UDP
packet containing the host name to a DNS server. The
server replies with a UDP packet containing the host's
IP address.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
35
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Remote Procedure Call (RPC)
•
•
•
Sending a message to a remote host and getting a reply
back is a lot like making a function call in a programming
language.
Both cases start with one or more parameters and the
result get back, i.e., arrange request-reply interactions on
networks in the form of procedure calls.
Example: A procedure named get_IP_address (host_name)
that works by sending a UDP packet to a DNS server and
waiting for the reply, timing out and trying again if one is
not forthcoming quickly enough. Thus, all the details of
networking can be hidden from the programmer.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
36
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Remote Procedure Call (RPC)
•
•
•
•
Remote Procedure Call (RPC) is allowing programs to call
procedures located on remote hosts.
When a process on machine 1 calls a procedure on
machine 2, the calling process on 1 is suspended and
execution of the called procedure takes place on 2.
Information can be transported from the caller to the callee
in the parameters and can come back in the procedure
result. No message passing is visible to the programmer.
RPC becomes the basis for many networking applications
in which the calling procedure is known as the client/caller
and the called procedure is known as the server/callee.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
37
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Steps in making a remote procedure call.
The stubs are shaded.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
38
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The Real-Time Transport Protocol
•
•
Client-server RPC is one area in which UDP is used.
Another area is
1. Real-time multimedia applications
•
2. Internet radio
3. Internet telephony
4. music-on-demand
5. videoconferencing
6. video-on-demand
7. other multimedia applications
Thus, it becomes clear that having a generic Real-time
Transport Protocol (RTP) for multiple applications would
be very useful.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
39
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
(a) The position of RTP in the protocol stack.
(b) Packet nesting.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
40
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The RTP Operation
•
•
The basic function of RTP is to multiplex several realtime data streams onto a single stream of UDP packets.
RTP operates as follows:
 The multimedia application consists of multiple audio, video,
text, and possibly other streams. These are fed into the RTP
library, which is in user space along with the application.
 This library then multiplexes the streams and encodes them in
RTP packets, which it then stuffs into a socket.
 At the other end of the socket (in the operating system kernel),
UDP packets are generated and embedded in IP packets. If the
computer is on an Ethernet, the IP packets are then put in
Ethernet frames for transmission.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
41
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The RTP Operation
•
•
•
The position of RTP in the protocol stack is somewhat
strange.
Since it runs in user space and is linked to the
application program, it certainly looks like an application
protocol.
On the other hand, it is a generic, applicationindependent protocol that just provides transport
facilities, so it also looks like a transport protocol.
The best description is that it is a transport protocol that is
implemented in the application layer.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
42
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The RTP Basic Function
•
•
•
The basic function of RTP is to multiplex several realtime data streams onto a single stream of UDP packets.
The UDP stream can be sent to a single destination
(unicasting) or to multiple destinations (multicasting).
RTP uses normal UDP, its packets are not treated
specially by the routers unless some normal IP QoS
features are enabled.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
43
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The RTP Operation
•
•
•
•
Each packet sent in an RTP stream is given a number
one higher than its predecessor. This numbering allows
the destination to determine if any packets are missing.
If a packet is missing, the best action for the destination
is to approximate the missing value by interpolation.
Retransmission is not a practical option since the
retransmitted packet would probably arrive too late to
be useful.
As a consequence, RTP has no flow control, no error
control, no acknowledgements, and no mechanism to
request retransmissions.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
44
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The RTP Operation
•
•
•
•
Each RTP payload may contain multiple samples, and
they may be coded any way that the application wants.
To allow for interworking, RTP defines several profiles
(e.g., a single audio stream), and for each profile,
multiple encoding formats may be allowed.
For example, a single audio stream may be encoded as
8-bit PCM samples at 8 kHz, delta encoding, predictive
encoding, GSM encoding, MP3, and so on.
RTP provides a header field in which the source can
specify the encoding but is otherwise not involved in
how encoding is done.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
45
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The RTP Operation
• Real-time applications need a timestamping.
• The idea is to allow the source to associate a timestamp
with the first sample in each packet.
•
•
•
The timestamps are relative to the start of the stream, so
only the differences between timestamps are significant.
The absolute values have no meaning.
Timestamping allows the destination to do a small amount
of buffering and play each sample the right number of
msec after the start of the stream, independently of when
the packet containing the sample arrived.
The timestamping allows multiple streams to be
synchronized with each other.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
46
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The RTP Operation
•
•
•
For example, a digital television program might have a
video stream and two audio streams.
The two audio streams could be for stereo broadcasts
or for handling films with an original language
soundtrack and a soundtrack dubbed into the local
language, giving the viewer a choice.
Each stream comes from a different physical device,
but if they are timestamped from a single counter, they
can be played back synchronously, even if the streams
are transmitted somewhat erratically.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
47
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The RTP Frame Structure
•
The RTP header consists of three 32-bit words and
potentially some extensions. The first word contains
1. The Version field, which is already at 2.
2. The P bit indicates that the packet has been padded
to a multiple of 4 bytes. The last padding byte tells
how many bytes were added.
3. The X bit indicates that an extension header is
present.
4. The CC field tells how many contributing sources
are present, from 0 to 15.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
48
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The RTP Frame Structure
5. The M bit is an application-specific marker bit. It can
be used to mark the start of a video frame, the start
of a word in an audio channel, or something else
that the application understands.
6. The Payload type field tells which encoding
algorithm has been used (e.g., uncompressed 8-bit
audio, MP3, etc.). Since every packet carries this
field, the encoding can change during transmission.
7. The Sequence number is just a counter that is
incremented on each RTP packet sent. It is used to
detect lost packets.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
49
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The RTP Frame Structure
•
•
•
The timestamp is produced by the stream's source to
note when the first sample in the packet was made.
This value can help reduce jitter at the receiver by
decoupling the playback from the packet arrival time.
The Synchronization source identifier tells which stream
the packet belongs to. It is the method used to multiplex
and demultiplex multiple data streams onto a single
stream of UDP packets.
The Contributing source identifiers, if any, are used
when mixers are present in the studio. In that case, the
mixer is the synchronizing source, and the streams
being mixed are listed here.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
50
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The RTP header.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
51
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The Real-time Transport Control Protocol (RTCP)
•
•
•
RTP has a little sister protocol called Real-time
Transport Control Protocol (RTCP).
It handles feedback, synchronization, and the user
interface but does not transport any data.
RTCP provides feedback on delay, jitter, bandwidth,
congestion, and other network properties to the
sources.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
52
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The Real-time Transport Control Protocol (RTCP).
•
•
This information can be used by the encoding process
to increase the data rate when the network is
functioning well and to cut back the data rate when
there is trouble in the network.
Providing continuous feedback, the encoding
algorithms can be continuously adapted to provide the
best quality possible under the current circumstances.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
53
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The RTCP Example
•
•
For example, if the bandwidth increases or decreases
during the transmission, the encoding may switch from
MP3 to 8-bit PCM to delta encoding as required.
The payload type field is used to tell the destination
what encoding algorithm is used for the current packet,
making it possible to vary it on demand.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
54
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Other Functions of the RTCP
•
•
RTCP handles interstream synchronization. The
problem is that different streams may use different
clocks, with different granularities and different drift
rates. RTCP can be used to keep them in sync.
RTCP provides a way for naming the various sources
(e.g., in ASCII text). This information can be displayed
on the receiver's screen to indicate who is talking at the
moment.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
55
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Internet Protocol (IP)
•
•
•
Internet protocol (IP) is a network layer protocol
that is used as the glue that holds the whole
Internet together.
It was designed with internetworking in mind.
The job of the network layer is to provide a besteffort way to transport datagrams across the
network.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
56
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Communication in the Internet
•
•
•
The transport layer breaks the data stream and
breaks it up into datagrams.
Datagrams can be up to 64 Kbytes, but are
usually limited to not more than 1500 bytes so
that they can fit into an Ethernet frame.
If frames get fragmented during the trip, that is not
an issue – they will be reconstructed at the
destination machine.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
57
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The Internet is an interconnected collection of many networks.
Network
Layers
- Dr. Hussein
Al-Bahadili
58
Amman Arab University for GraduateNetwork
Studies –and
Graduate
College
of Computing
Studies
– Computer Networks – Dr. Hussein Al-Bahadili
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The IP Protocol
•
•
•
An IP datagram consists of a header part and a text
part.
The header has a 20-byte fixed part and a variable
length optional part.
It is transmitted in big endian order from left to right,
with the high-order bit of the Version field going first.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
59
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The Internet protocol IPv4 header (1/3)
Field
Length
Description
Version
4-bit
Specify the version of the protocol the datagram
belongs to.
IHL
4-bit
Specify the length of the header.
Type of
service
6-bit
Specify the classes of services. These classes
include the four queuing priorities, three discard
probabilities, and historical classes.
Not used
2-bit
-
Total length
16-bit
Include everything in the datagram-both the header
and data. The maximum length is 65,535 bytes.
Identification
16-bit
Allow the destination host to determine which
datagram a newly arrived fragment belongs to. All the
fragments of a datagram contain the same
identification value.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
60
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The Internet protocol IPv4 header (2/3)
Field
Length
Description
Not used
1-bit
-
DF
1-bit
Don’t fragment
MF
1-bit
More fragment.
Fragment
offset
13-bit
Tells where in the current datagram this fragment
belongs. Since 13-bits are provides, there is a
maximum of 8192 fragments per datagram, giving a
maximum datagram length of 65,536 bytes, one more
than the Total length field.
Time of live
8-bit
A counter used to limit the packet lifetimes. It is
supposed to count time in seconds, allowing a
maximum lifetime of 255 seconds.
Protocol
8-bit
Tells the network layer which transport process to give
the datagram to (e.g., TCP, UDP, etc.)
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
61
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The Internet protocol IPv4 header (3/3)
Field
Length
Description
Header
checksum
16-bit
Verifies the header only.
Source
address
32-bit
Indicate the network number.
Destination
address
32-bit
Indicate the host number
Options
>=0
Design to provide an escape to allow subsequent
versions of the protocol to include information not
present in the original design, to permit experimenters
to try out new ideas, and to avoid allocating header
bits to information that is rarely needed.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
62
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The IPv4 (Internet Protocol) header.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
63
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Some of the IP Options
•
•
•
•
The options are variable length.
Each option begins with a 1-byte code identifying the
option. Some options are followed by a 1-byte option
length field, and then one or more data bytes.
The options field is padded out to multiple of four bytes.
Some of the IP options are:
1.
2.
3.
4.
5.
Security
Strict source routing
Loose source routing
Record route
Timestamp
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
64
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
5-54
Some of the IP options.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
65
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
IP Addresses
•
•
•
•
•
Every host and router on the Internet has an IP address
that encodes: (i) Network number, and (ii) Host number.
The IP address, which is a combination of the network
number and the host number, is unique, and, in
principle, no two machines on the internet have the
same IP address.
All IP addresses are 32 bits long.
The IP address refers to a network interface, so if a host
on two networks, it must have two IP addresses.
Most hosts are on one network and thus have one IP
address.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
66
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Classful Addressing
•
IP addresses, which are written in dotted decimal
notation, are divided into five classes, namely Class A,
B,C, D, and E.
Range of Host Addresses
Class
Number of
From
To
Network
Host
A
1.0.0.0
127.255.255.255
128
16,777,216
B
128.0.0.0
191.255.255.255
16,384
65,536
C
192.0.0.0
223.255.255.255
2,097,152
256
D
224.0.0.0
239.255.255.255
Multicast address
E
240.0.0.0
255.255.255.255
Reserved for future use
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
67
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Class A IP address
•
•
A unicast IP address that ranges from 1.0.0.1 to
126.255.255.254.
The first octet indicates the network, and the last
three octets indicate the host on the network.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
68
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Class B IP address
•
•
A unicast IP address that ranges from 128.0.0.1 to
191.255.255.254.
The first two octets indicate the network, and the last
two octets indicate the host on the network.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
69
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Class C IP address
•
•
•
A unicast IP address that ranges from 192.0.0.1 to
223.255.255.254.
The first three octets indicate the network, and the
last octet indicates the host on the network.
Network Load Balancing provides optional session
support for Class C IP addresses (in addition to
support for single IP addresses) to accommodate
clients that make use of multiple proxy servers at the
client site.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
70
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
IP address formats.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
71
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Special IP addresses.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
72
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Subnets
•
•
•
•
According to the addressing approached addressed
earlier, all the hosts in the network must have the
same network number.
A LAN may grow to be too large to handle and must
be split into subnets.
The subnets work like small LANs inside a larger LAN,
but allow the entire LAN to look like a single network to
the outside world.
This allows different subnets to be connected within an
organization.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
73
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
A campus network consisting of LANs for various departments.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
74
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Subnet Masks
•
•
•
•
To implement subnetting, the router needs a subnet
mask that indicates the split between network +
subnet number and host.
A subnet mask is used by the router to determine
which subnet the packet should travel to.
The mask can be specified in dotted decimal notation
(255.255.252.0) or simply by indicating the size of the
mask (/22)
The subnet mask 255.255.252.0/22 is a 22 bit mask
allowing 64 subnets on a class B network.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
75
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
A class B network subnetted into 64 subnets.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
76
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Example: Subnet Masks
•
•
•
The 16-bit for the host number is divided between
subnet number of 6-bit and host number of 10-bit.
This allows up to 64 subnets each with 1022 hosts
(where all 0s and 1s are not used)
The subnets are counting by four as shown below:
Subnet 1: 10000010 00110010 000001|00 00000001
130.
24.
4.
1
Subnet 2: 10000010 00110010 000010|00 00000001
130.
24.
8.
1
Subnet 3: 10000010 00110010 000011|00 00000001
130.
24.
12.
1
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
77
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Subnet Masks
•
•
Routers will AND the destination address with the
subnet mask in order to get the address of the router
where the packet should go.
Using this method reduces the number of individual
addresses that each router must store, resulting in
smaller router tables.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
78
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The Three Bears Problem
•
•
•
•
We can only have 128 Class A networks with 16
million hosts each – too big.
We can have 16,384 Class B networks with 64,000
hosts each – still too big.
We can have 2 million Class C networks with 256
hosts each – much too small.
There are too many people under-utilizing Class B
networks, resulting in a shortage in IP addresses.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
79
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Classless InterDomain Routing
•
•
As opposed to allocating IP addresses based on class,
the basic idea behind CIDR is to allocate the
remaining IP addresses in variable-sized blocks.
If a site needs (N=732) addresses, we would allocate
the next highest number of addresses based on
boundaries ( b = Int(ln(N) / ln(2)) ).
Number of addresses should be allocated = 2b+1
•
This makes routing more difficult as subnet masks do
not work so well.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
80
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Classful Addressing Forwarding
•
In a classful system, forwarding works like this:
1. When a packet arrives at a router, a copy of the IP address is
shifted right 28 bits to yield a 4-bit class number.
2. A 16-way branch then sorts packets into A, B, C, and D, with 8 of
the cases for class A, 4 of the cases for class B, 2 of the cases for
class C, and 1 each for class D and class E.
3. The code for each class then masked off the 8-, 16-, or 24-bit
network number and right aligned it in a 32-bit word.
4. The network number was then looked up in the A, B, or C table.
5. Once the entry was found, the outgoing line could be looked up
and the packet forwarded.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
81
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
CIDR Forwarding
•
CIDR forwarding works like this:
1. Each routing table is extended by giving it a 32-bit mask. Thus,
there will be a single routing table for all networks consisting of an
array of (IP address, subnet mask, outgoing line).
2. When a packet comes in, its destination IP address is first
extracted.
3. Then the routing table is scanned entry by entry, masking the
destination address and comparing it to the table entry looking for
a match.
4. It is possible that multiple entries (with different subnet mask
lengths) match, in this case the longest mask is used.
Complex algorithms have been devised to speed up the address
matching process.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
82
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
CIDR Forwarding - Example
•
•
•
Consider an example in which a million of addresses are
available starting at 194.24.0.0.
Find out the starting address and the last address to be assigned
for each university to meet their requirements
Cambridge
2048 addresses
Oxford
4096 addresses
Edinburgh
1024 addresses
The routing tables all over the world are now updated with the
three assigned entries, each entry contains a base address and a
subnet mask. The entries (in binary) are:
C: 11000010 00011000 00000000 00000000
11111111 11111111 11111000 00000000
E: 11000010 00011000 00010000 00000000
11111111 11111111 11111100 00000000
O: 11000010 00011000 00001000 00000000
11111111 11111111 11110000 00000000
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
83
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Message Forwarding
•
Forwarding a message to the following address:
194.24.17.4
•
•
IP routers forward packets based on the network ID
Single entry in the forwarding table (network ID) for
all the hosts connected to that network – network
aggregation.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
84
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
5-59
A set of IP address assignments.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
85
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Network Address Translation (NAT)
•
•
•
Network Address Translation (NAT) can be used by
companies when they run out of IP addresses to
assign machines.
The NAT process involves using private internal
IP
addresses and then translating those IP addresses to
a valid IP address when leaving the LAN.
This translation is done by a NAT box.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
86
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Placement and operation of a NAT box.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
87
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Network Address Translation (NAT)
• To make the NAT scheme possible, three ranges of
IP
addresses have been declared as private addresses.
• Companies may used them internally as they wish. The
only rule is that no packet containing these addresses
may appear on the Internet itself.
• The three reserved ranges are:
10.0.0.0
- 10.255.255.255/8
172.16.0.0 - 172.31.255.255/12
192.168.0.0 - 192.168.255.255/16
(16,777,216 hosts)
(1,048,576 hosts)
(65,536 hosts)
• The first range is the usual choice of most companies.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
88
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
NAT Box
•
•
•
The NAT box is able to translate and keep track of
addresses by using a large translation table.
As incoming packets arrive at the NAT box, it looks
up the source port field of the TCP or the UDP
transport layer protocols which was used as an
index to the internal IP address in the NAT table.
NAT tables are widely used.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
89
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
NAT Issues
1. It violates the architectural model of IP – that each IP address is
associated with only one machine on the Internet.
2. It changes the Internet into a “connection-oriented” network. The
NAT box maintains the state of the connection, and if it crashes,
so does the link.
3. Protocol layer k makes assumptions about what protocol layer
k+1 has put in the payload, violating layer independence.
4. NAT can/may/will fail if some protocols other than TCP or UDP
are used.
5. If IP addresses are inserted into the payload data (i.e. text of the
message), then the NAT table will not translate that information
and trouble could occur.
6. The limit of a NAT machine is 61,440 machines.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
90
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Internet Control Protocols
•
In addition to the Internet Protocol (IP), which is used
for data transfer, the Internet has several control
protocols used in the network layer, these include
ICMP
- The Internet Control Message Protocol
ARP
- The Address Resolution Protocol
RARP
- Reverse Address Resolution Protocol
BOOTP - The Bootstrap Protocol
DHCP
- The Dynamic Host configuration Protocol
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
91
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The Internet Control Message Protocol (ICMP)
•
•
•
•
The operation of the Internet is monitored closely by
the routers.
When something unexpected occurs, the event is
reported by the ICMP (Internet Control Message
Protocol), which used also to test the Internet.
About a dozen types of ICMP messages are defined.
Each ICMP message type is encapsulated in an IP
packet.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
92
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
5-61
The principal ICMP message types.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
93
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The Address Resolution Protocol (ARP)
•
•
•
•
•
•
Every machine on the Internet has a 32-bit IP addresses, which
differs from the 48-bit Ethernet address.
In a LAN, the Ethernet boards send and receive frames based on
48-bit Ethernet address without any consideration to the 32-bit IP
address.
The question now arises: How do IP addresses get mapped
onto DLL addresses, such as Ethernet?
A better solution is to output a broadcast packet onto the Ethernet
asking: Who owns the requested IP address?
The reply will come from the machine that has the requested IP
address to tell the Ethernet address of the machine that has the
requested IP address.
The protocol used for asking this question and getting reply is
called ARP (Address Resolution Protocol).
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
94
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Three interconnected /24 networks: two Ethernets and an FDDI ring.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
95
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The Reverse Address Resolution Protocol (RARP)
• ARP solves the problem of finding out which Ethernet
address corresponds to a given IP address.
• How can we find the IP address for a particular
Ethernet address?
• The first solution revised was to use the Reverse
Address Resolution Protocol (RARP).
• This protocol allows a newly-booted workstation to
broadcast its Ethernet address and ask: Does anyone
out there know my IP address?
• The RARP server sees this request, looks up the
Ethernet address in its configuration files, and sends
back the corresponding IP address.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
96
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Advantages and Disadvantages of RARP
•
•
Advantages
RARP does not require to embed the IP address in the
memory image so that it allows the same image to be
used on all machines. If the IP address were buries
inside the image, each workstation would need its own
image.
Disadvantages
RARP uses a destination address of all 1s (limited
broadcasting) to reach the RARP server. Such
broadcast are not forwarded by routers, so a RARP
server is needed on each network.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
97
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Bootstrap Protocol (BOOTP)
•
•
In order to avoid using an RARP server on each
network, an alternative bootstrap protocol (BOOTP)
was invented.
BOOTP uses UDP messages, which are forwarded
over routers. It also provides a diskless workstation
with additional information, including
1- The IP address of the file server holding the memory image.
•
2- The IP address of the default router, and subnet mask to use.
A serious problem with BOOTP is that it requires
manual configuration of tables mapping IP address to
Ethernet address.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
98
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Dynamic Host Configuration Protocol (DHCP)
•
•
•
To eliminate the error-prune step that may be occurred
due to the manual setup of the IP and Ethernet
addresses, BOOTP was extended and given a new
name: Dynamic Host Configuration Protocol (DHCP).
DHCP allows both manual IP address assignment and
automatic assignment. It is based on the idea of a special
server that assigns IP address to hosts asking for them.
This server needs not be on the same LAN as requesting
host. The DHCP server may not be reachable by
broadcasting, therefore a DHCP relay agent is needed on
each LAN.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
99
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Operation of DHCP.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
100
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Dynamic Host Configuration Protocol (DHCP)
•
•
•
•
To find its IP address, a newly-booted machine
broadcasts a DHCP DISCOVER packet.
The DHCP relay agent on its LAN intercepts all DHCP
broadcasts. When it finds a DHCP DISCOVER packet, it
sends the packet as a unicast packet to the DHCP
server, possibly on a distant network.
The only piece of information the relay agent needs is the
IP address of the DHCP server.
An issue arises: How long an IP address should be
allocated? Addresses are usually leased for a specific
period of time.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
101
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Routing Protocols
•
•
•
The Internet is made up of a number of autonomous
systems (AS).
Each AS is operated by a different organization and
can use its own routing algorithm inside.
There are two types of routing algorithms:
1. Interior gateway protocol: A routing algorithm within
an AS.
2. Exterior gateway protocol: An algorithm for routing
between ASes.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
102
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Interior Gateway Routing Protocol
• The original Internet interior gateway protocol was a
distance vector protocol, namely, the routing
information protocol (RIP) based on the Bellman-Ford
algorithm inherited from the ARPANET.
• The RIP has the following disadvantages:
•
•
1. It works well in small systems, but less well as ASes get larger.
2. It suffers from the count-to-infinity problem and generally slow
convergence.
It replaced in May 1979 by a link state protocol.
In 1988, the IETF began work on a new protocol called
OSPF (Open Shortest Path First), which became a
standard in 1990.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
103
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Routing Protocol Requirements
•
The group designing the OSPF protocol had a long list
of requirements that had to be met, these include:
1. The algorithm had to be published in the literature.
2. It had to support a variety of distance matrics,
including physical distance, delay, and so on.
3. It had to be dynamic algorithm, one that adapted to
changes in the topology automatically and quickly.
4. It had to support routing based on type of service.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
104
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Routing Protocol Requirements
5. It had to do load balancing, splitting and load over
multiple lines.
6. It should provide support for hierarchical system.
7. It required some modicum of security to prevent funloving users from spoofing routers by sending them
false routing information.
8. It needed a provision for dealing with routers that
were connected to the Internet via a tunnel.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
105
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
OSPF Connections and Networks
•
OSPF supports three kinds of connections and networks:
1. Point-to-point lines between exactly two routers.
2. Multiaccess networks with broadcasting (e.g., most LANs)
3. Multiaccess networks without broadcasting (e.g., most
packet-switched WANs).
•
A multiaccess network is one that can have multiple
routers on it, each of which can directly communicate
with all others (All LANs and WANs have this property).
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
106
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
OSPF Operation
• OPSF operates by abstracting the collection of actual
networks, routers, and lines into a directed graph in
which each arc is assigned a cost (distance, delay, etc.).
• It then computes the shortest path based on the weights
on the arcs.
• A serial connection between two routers is represented
by a pair of arcs, may be of different weight, one in each
direction.
• A multiaccess network is represented by a node for the
network itself plus a node for each router.
• The arcs from the network node to the routers have
weight 0, and normally not shown on the graph.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
107
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
(a) An autonomous system. (b) A graph representation of (a).
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
108
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
OSPF Operation
• Many of the ASes in the Internet are themselves large
and nontrivial to manage.
• OSPF allows them to be divided into numbered areas,
where an area is a network or a set of non overlapped
contiguous networks.
• Every AS has a backbone, called area 0. All area are
connected to the backbone, possibly by tunnels, so it is
possible to go from one area to another area in the AS
via the backbone.
• A tunnel is represented as an arc and has a cost.
• Each router that is connected to two or more area is part
of the backbone.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
109
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
OPSF Normal Operation Routes
• During normal operation, three kinds of routes may be
needed:
1. Intra-area routing which is the easiest, since the
source router already knows the shortest path to the
destination router.
2. Inter-area routing which always proceeds in three
steps:
a. Go from the source to the backbone.
b. Go across the backbone to the destination area.
c. Go to destination.
3. Inter-AS
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
110
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Types of OSPF Routers
•
OPSF distinguishes four classes of routers:
1. Internet routers are wholly within one area.
2. Area border routers connect two or more areas.
3. Backbone routers are on the backbone
4. AS boundary routers talks to routers in other ASes.
•
Routers may also be classified as
1. Adjacent routers which can exchange information between them.
2. Neighboring routers which don’t exchange information been them.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
111
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The relation between ASes, backbones, and areas in OSPF.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
112
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Types of OSPF Messages
•
•
There are a number of standard messages that
adjacent routers exchange at the startup or
periodically.
All these messages are sent as raw IP packets.
The five types of OSPF messages.
Network
Layers
- Dr. Hussein
Al-Bahadili
113
Amman Arab University for GraduateNetwork
Studies –and
Graduate
College
of Computing
Studies
– Computer Networks – Dr. Hussein Al-Bahadili
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
BGP – The Exterior Gateway Routing Protocol
•
•
•
The OPSF protocol is used within a single AS to move packets as
efficiently as possible from the source to the destination. It doesn’t
have to worry about politics.
The Border Gateway Protocol (BGP) is used to exchange
information between ASes, and has to carefully consider politics.
Typical policies involve political, security, or economic
considerations. A few example of routing constraints are:
1. No transit traffic through certain ASes.
2. Never put Iraq on a route starting at the Pentagon
3. Do not use US to get from British Columbia to Ontario.
4. Only transit Albania if there is no alternative to the destination.
5. Traffic staring or ending at IBM should not transit Microsoft.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
114
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
BGP Network Groups
•
Given BGP’s special interest in transit traffic, networks
are grouped into one of three categories:
1. Stub networks: which have only one connection to the BGP
graph. It cannot be used for transit traffic because there is no one
on the other side.
2. Multiconnected networks: which could be used for transit traffic,
except that they refused.
3. Transit networks: such as backbone which are willing to handle
third-party packets, possibly with some restrictions, and usually
for pay.
•
Pairs of BGP routers communicate with each other by
establishing TCP connections.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
115
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Features of BGP
•
The main features of the BGP are:
1. Maintains the cost to each destination.
2. Keeps track of the path used.
3. Tells its neighbors the exact path it is using.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
116
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
The Network Layer
(a) A set of BGP routers. (b) Information sent to F.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
117
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Internet Multicasting
•
•
•
•
•
Normal IP communication is between one sender and
one receiver.
However, for some applications it is useful for a
process to be able to send to a large number of
receivers simultaneously (multicast).
IP supports multicasting, using a class D addresses.
Each class D address identify a group of hosts.
There are 28-bit are available for identifying groups, so
over 250 million groups can exist at the same time.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
118
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Internet Multicasting
•
•
•
There are two kinds of group addresses, these are
1. Permanent addresses
2. Temporary addresses
A permanent group is always there and does not have to be
setup, while a temporary group must be created before it can be
used.
Each permanent group has a permanent group address, some
examples of permanent group addresses are:
224.0.0.1
All systems on a LAN.
224.0.0.2
All routers on a LAN.
224.0.0.5
All OSPF routers on a LAN.
224.0.0.6
All designated OSPF routers on a LAN.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
119
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Internet Group Management Protocol (IGMP)
•
•
•
•
•
Multicasting is implemented by special multicast routers, which may
or may not be collocated with the standard routers.
A bout once a minute, each multicast router sends a hardware (DLL)
multicast to the hosts on its LAN (address 224.0.0.1) asking them to
report back on the groups their processes currently belong to.
Each host sends back a responses for all the class D addresses it is
interested in.
These query and response packets use a protocol call IGMP, which
has two kinds of packets: query and response.
Each of the above packets are with a simple, fixed format containing
some control information in the first word of the payload field and a
class D address in the second word.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
120
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Mobile IP (The Problem)
•
•
Every user of the Internet has his own IP address
which consists of two parts: the network number and
the host number.
The message for a particular user is delivered to its
network which is responsible to deliver it to the host.
What will happened when a host wants to move away
(be mobile) to a new site (i.e., network)?
•
To be mobile is a requirement which has to be
considered, because many users of the Internet have
portable computers and want to stay connected to the
Internet when they visit a distant Internet site.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
121
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Mobile IP (Nonpractical Solutions)
•
In order to enable mobile users stay connected to the
Internet, some solutions could be:
1. Giving the machine a new IP address corresponding
to its new locations is unattractive because large
numbers of people, programs, and databases would
have to be informed of the change.
2. Force the routers to use complete IP addresses for
routing, instead of just the network number. However,
this strategy would require each router to have millions
of table entries, at astronomical cost to the Internet.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
122
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Mobile IP (IETF Requirements for the Solution)
•
•
Due to the huge demands by the internet users to have the ability
to connect their notebook computers to the Internet where ever
they were, the IETF set up a Working Group to find a solution.
The Working Group quickly formulated a number of requirements
considered desirable in any solution. The major ones are
1. Each mobile host must be able to use its home IP address
anywhere.
2. Software changes to the fixed hosts were not permitted.
3. Changes to the router software and tables were not permitted.
4. Most packets for mobile hosts shouldn’t make detours on the way.
5. No overhead should be incurred when a mobile host is at home.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
123
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Mobile IP (The Solutions)
•
In what follow a revision for the solution is given
1. Every site that wants to allow its users to roam has to create a
home agent.
2. Every site that wants to allow visitors to use its network has to
create a foreign agent.
3. When a mobile host shows up at a foreign site, it contacts the
foreign agent host there and registered.
4. The foreign host then contacts the user’s home and gives it a
care-of address, normally the foreign agent’s own IP address.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
124
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Mobile IP (The Solutions)
5. When a packet arrives at the host’s network router.
6. The router then tries to locate the host by broadcasting an ARP
packet asking about the Ethernet address of the host.
7. The home agent responds to this query by giving its own Ethernet
address.
8. The router then sends the packet to the home agent.
9. The home agents, in turn, tunnels the packet to the care-of address
by encapsulating them in the payload field of an IP packet addressed
to the foreign agent.
10.The foreign agent then de-encapsulates and delivers the packet to
data link address of the mobile host.
11.In addition, the home agent gives the care-of address to the sender,
so future packets can be tunneled directly to the foreign agent.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
125
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Mobile IP (Gratuitous ARP)
• At the time the mobile host moves, the router probably
has its Ethernet address cached which is soon-to-beinvalid (i.e., after the host leave the network).
• According to the new solution, the mobile host Ethernet
address is replaced by the home agent Ethernet address.
• Replacing the mobile host Ethernet address with the
home agent Ethernet address is done by a trick called
gratuitous ARP.
• Gratuitous ARP is a specific cache entry of the mobile
host about to leave.
•
When a mobile host returns later, the same trick is used to
update the router’s cache again.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
126
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Mobile IP (Solution of other Problems)
•
The IETF solution for mobile hosts solves a number of other problems,
such as:
1. How are agents located? The solution is for each agent to
periodically broadcast its address and the type of services it is willing to
provide (e.g., home, foreign, or both).
When a mobile host arrives somewhere, it can just listen for these
broadcasts, called advertisements, and broadcast a packet announcing
its arrival and hope that the local foreign agent responds to it.
2. What to do about impolite mobile hosts that leave without saying
goodbye? The solution is to make the registration valid only for a fixed
time interval. If it is not refreshed periodically, it times out, so foreign
host can clear tables.
3. What to do about security? The solution is to use cryptographic
authentication protocols.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
127
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
Mobile IP (Recursive Tunneling)
• Levels of mobility is an important issue to be addressed
by the Mobile IP Working Group.
• This problem arises in an airplane with an on-board
Ethernet used by the navigation, avionics, and
passengers computers.
• In this setup there are two levels of mobility:
•
1. The aircraft’s own computers, which are stationary with respect
to the Ethernet, and the passengers’ computers which are
mobile with respect to it
2. The on-board router which is mobile with respect to the routers
on the ground.
Being mobile with respect to a system that is itself
mobile can be handled using recursive tunneling.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
128
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
IPv6
•
•
CIDR and NAT increased the number of IPv4
addresses slightly, which were not enough with the
astronomical expansion in the number of users for
the Internet.
In 1990, IETF started work on a new version, one
which would never run out of addresses, would
solve a variety of related problems, and be more
flexible and efficient as well.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
129
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
IPv6 Goals
•
1.
2.
3.
4.
5.
6.
7.
8.
9.
The major IPv6 goals were:
Support billions of hosts (even with inefficient address space
allocation).
Reduce routing table size.
Simplify the protocol to speed up packet processing at routers.
Provide better security.
Pay more attention to type of service to aid in QoS concerns for
real-time data.
Aid multicasting by allowing scopes to be specified.
Make it possible for a host to roam without changing addresses.
Allow space for the protocol to evolve.
Permit the old and new protocols to coexist for a number of years
until IPv6 was used exclusively.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
130
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
IPv6
• IPv6 was known as SIPP (Simple Internet Protocol Plus).
• Addressing is done with 16 bytes (128 bits) greatly
increasing the address space.
• Reduces the number of fields from 13 to 7.
• Authentication and privacy are parts of the protocol.
• The issue of QoS was addressed.
• IPv6 is not compatible with IPv4, but it is compatible with
other auxiliary Internet protocols, including TCP, UDP,
ICMP, IGMP, OSPF, BGP, and DNS.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
131
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
IPv6 Addressing
•
The address space is written as eight groups of four
hex digits, such as:
8000:0000:0000:0000:0123:4567:89AB:CDEF
•
Optimizations:
– Leading zeros can be dropped
– One or more groups of zeros can be replaced with
two semicolons “::”
– IPv4 addresses can be accesses as:
::130.15.1.100
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
132
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
IPv6 Address Space
•
There are:
– 2128 possible addresses. Or:
– 3 x 1038 possible address. Or:
– If the entire surface of the earth (land and water) were
covered with computers, IPv6 would allow 7 x 1023 IP
addresses per square meter. That’s almost one IP
address for each molecule.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
133
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
IPv6 Implementation
•
•
•
•
It was expected that the shift to IPv6 would take about
a decade.
IPv6 groups will begin, tunnelling information between
them.
It is expected that these groups will grow until they
become the majority on the Internet.
Once this happens, it is just time until everyone else
follows suit.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
134
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The IPv6 fixed header (required).
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
135
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
IPv6 extension headers.
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
136
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The hop-by-hop extension header for large datagrams (jumbograms).
Amman Arab University for Graduate Studies – Graduate College of Computing Studies – Computer Networks Modeling and Simulation
Network
and Network
Layers
- Dr. Hussein Al-Bahadili
137
(Dr. Hussein
Al-Bahadili
– [email protected])
Computer Networks
Modeling and Simulation
TCP/IP
Fundamentals
The extension header for routing.