TCP IP - IP Protocol Suite PDF
TCP IP - IP Protocol Suite PDF
Contents
e Transport level
e.
1
11/10/2010
2
11/10/2010
3
11/10/2010
4
11/10/2010
Types of service
5
11/10/2010
6
11/10/2010
7
11/10/2010
Protocol values
Example 1
8
11/10/2010
Example 2
Solution
The HLEN value is 8, which means the total number of
bytes in the header is 8 × 4, or 32 bytes.
The first 20 bytes are the base header,
header the next 12
bytes are the options.
Example 3
Solution
The HLEN value is 5, which means the total number of
bytes in the header is 5 × 4, or 20 bytes (no options)
The total length is 40 bytes,
bytes which means the packet is
carrying 20 bytes of data (40 − 20).
9
11/10/2010
Example 4
10
11/10/2010
11
11/10/2010
Fragmentation example
12
11/10/2010
Example 5
Solution
If the M bit is 0, it means that there are no more
fragments; the fragment is the last one.
However, we cannot say iff the original packet was
fragmented or not.
A non-fragmented packet is considered the last
fragment.
Example 6
Solution
If the M bit is 1, it means that there is at least one more
fragment.
This fragment can be the first one or a middle one, but
nott the
th last
l t one.
We don’t know if it is the first one or a middle one; we
need more information (the value of the fragmentation
offset).
13
11/10/2010
Example 7
A packet has arrived with an M bit value of 1 and a
fragmentation offset value of 0. Is this the first fragment,
the last fragment, or a middle fragment?
Solution
Because the M bit is 1, it is either the first fragment or a
middle one.
Because the offset
ff value is 0, it is the first
f f
fragment.
Example 8
Solution
To find the number of the first byte, we multiply the offset
value by 8.
This means that the first
f byte number is 800.
We cannot determine the number of the last byte unless
we know the length.
14
11/10/2010
Example 9
Solution
The first byte number is 100 × 8 = 800.
The total length is 100 bytes, and the header length is
20 bbytes (5 × 4),
4) which
hi h means that
h there
h are 80 b
bytes iin
this datagram.
If the first byte number is 800, the last byte number
must be 879.
15
11/10/2010
Note
Note
16
11/10/2010
17
11/10/2010
Example 1
Solution
We replace each group of 8 bits with its equivalent
decimal number ((see Appendix
pp B)) and add dots for
separation.
Example 2
Change the following IPv4 addresses from dotted-
decimal notation to binary notation.
Solution
We replace each decimal number with its binary
equivalent
18
11/10/2010
Example 3
Find the error, if any, in the following IPv4 addresses.
Solution
a. There must be no leading zero (045).
b. There can be no more than four numbers.
c. Each number needs to be less than or equal to 255.
d. A mixture of binary notation and dotted-decimal
notation is not allowed.
19
11/10/2010
Example 4
Find the class of each address.
a. 00000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
c. 14.23.120.8
d. 252.5.15.111
Solution
a. The first bit is 0. This is a class A address.
b Th
b. The fi
firstt 2 bits
bit are 1;
1 th
the thi
third
d bit iis 0
0. Thi
This iis a class
l C
address.
c. The first byte is 14; the class is A.
d. The first byte is 252; the class is E.
20
11/10/2010
21
11/10/2010
22
11/10/2010
Example 5
23
11/10/2010
24
11/10/2010
Example 6
Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32−28 rightmost bits to 0, we get
11001101 00010000 00100101 0010000
or
205.16.37.32.
This is actually the block shown in figure.
25
11/10/2010
Example 7
Find the last address for the block in Example 19.6.
Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32 − 28 rightmost bits to 1, we get
11001101 00010000 00100101 00101111
or
205.16.37.47
This is actually the block shown in figure.
26
11/10/2010
Example
27
11/10/2010
Example
Solution
Figure shows the situation.
Group 1
For this group, each customer needs 256 addresses.
This means that 8 (log2 256) bits are needed to define
each host. The prefix length is then 32 − 8 = 24. The
addresses are
Example
Group 2
For this group, each customer needs 128 addresses.
Thi means that
This th t 7 (log2
(l 2 128) bits
bit are needed
d d to
t define
d fi
each host. The prefix length is then 32 − 7 = 25. The
addresses are
28
11/10/2010
Example
Group 3
For this group, each customer needs 64 addresses. This
means that 6 (log264) bits are needed to each host. The
prefix length is then 32 − 6 = 26.
26 The addresses are:
29
11/10/2010
T bl Addresses
Table. Add for
f private
i t networks
t k
A NAT implementation
30
11/10/2010
Addresses in a NAT
31
11/10/2010
32
11/10/2010
33
11/10/2010
ARP operation
ARP packet
34
11/10/2010
35
11/10/2010
Example
A host with IP address 130.23.43.20 and physical
address B2:34:55:10:22:10 has a packet to send to
another host with IP address 130.23.43.25 and physical
address A4:6E:F4:59:83:AB. The two hosts are on the
same Ethernet network. Show the ARP request and reply
packets encapsulated in Ethernet frames.
Solution
The following figure shows the ARP request and reply
packets. Note that the ARP data field in this case is 28
bytes, and that the individual addresses do not fit in the
4-byte boundary. That is why we do not show the regular
4-byte boundaries for these addresses.
36
11/10/2010
Proxy ARP
RARP operation
37
11/10/2010
RARP packet
38
11/10/2010
39
11/10/2010
Error-reporting messages
Redirection concept
40
11/10/2010
Query messages
41
11/10/2010
42
11/10/2010
IGMP operation
Example
Imagine there are three hosts in a network, as shown in
the following figure.
A query message was received at time 0; the random
delay time (in tenths of seconds) for each group is
shown next to the group address.
Show the sequence of report messages.
Solution
The events occur in this sequence:
a. Time 12: The timer for 228.42.0.0 in host A expires,
and a membership report is sent, which is received
by the router and every host including host B which
cancels its timer for 228.42.0.0.
43
11/10/2010
Example
b. Time 30: The timer for 225.14.0.0 in host A expires,
and a membership report is sent which is received by
the router and every host including host C which
cancels
l itits ti
timer ffor 225
225.14.0.0.
14 0 0
Example
44
11/10/2010
e. Transport level
45
11/10/2010
Port numbers
46
11/10/2010
IANA ranges
47
11/10/2010
Socket address
48
11/10/2010
Error control
49
11/10/2010
50
11/10/2010
UDP length
= IP length – IP header’s length
51
11/10/2010
Stream delivery
52
11/10/2010
TCP segments
53
11/10/2010
Example
The following shows the sequence number for each
segment:
54
11/10/2010
Control field
55
11/10/2010
56
11/10/2010
57
11/10/2010
Data transfer
58
11/10/2010
Half-close
59
11/10/2010
Normal operation
Lost segment
60
11/10/2010
Fast retransmission
SCTP
61
11/10/2010
62