Professional Documents
Culture Documents
TCP IP Handouts
TCP IP Handouts
The TCP/IP protocol stack is the de-facto standard in networking It is an alternative for the OSI 7-layer model, which has never really been implemented in practice TCP/IP is an open standard and is the protocol used over the Internet It can be found in most modern day operating systems
4 4
TCP/IP defines only 5 layers (although these are not specifically mentioned in the standards) In the OSI model each layer performs specific functions In TCP/IP different protocols may be defined within a layer, each performing different functions. What is common about a set of protocols at the same layer is that they share the same set of support protocols at the next lower layer In the OSI model, a protocol at a given layer may be substituted by a new one without impacting on adjacent layers In TCP/IP the strict use of all layers is not mandated
Wide Area Networks 2
IP Header Fields
Version (4 bits)
4
Indicates the version number of the IP protocol being used. Allows for enhancements to the IP protocol. Current version is IPv4, however IPv6 has already been standardised and is in the process of being deployed Length of the IP header in 32-bit words. The minimum value is five, for a minimum header length of 20 octets Specifies reliability (1 bit), precedence (3 bits), delay (1 bit) and throughput (1 bit) parameters, 2 bits are unused Specifies the total IP datagram length in octets. Therefore the maximum number of octets in an IP datagram is 65535 (including the header)
Wide Area Networks 7
A sequence number that uniquely identifies an IP datagram throughout the entire internet (together with the source/destination addresses and the protocol type) More bit
used for fragmentation and reassembly
Flags (3 bits)
4
Indicates where in the original datagram this fragment belongs, measured in 64-bit units This implies that fragments other than the last fragment must contain a data field that is a multiple of 64 bits Indicates the next higher level protocol that is to receive the data field at the destination (e.g. TCP, UDP, or ICMP) The number of router hops before a datagram is discarded. At each passage through a router, this is decremented by one
Wide Area Networks 9
Used to detect errors in the IP header (only) If an error is detected the IP datagram is discarded Since the header is modified during the transit through a router, this is checked and re-computed at each router Used to indicate the source address which must be unique throughout the Internet (232 = 4,294,967,296) Same as Source Address, but for the destination Special addresses are reserved for multicasting and broadcasting
Protocol (8 bits)
4
Time-to-live (8 bits)
4
10
Used to ensure that the Options part of the header is a multiple of 32 bits
at the destination only as soon as a larger datagram size may be used (in a router)
Datagrams Reassembly
Destination only reassembly
4 4
IP Datagrams Fragmentation
At the source, a datagram will have the offset field = 0 and the more-flag set to 0 If a router needs to segment a datagram it performs the following actions:
4
Datagrams may only get smaller as they traverse an internet This may impact on the efficiency of the underlying network access protocol Large buffer space is required to reassembly datagrams All fragments of a datagram must pass through the same router, inhibiting the use of dynamic routing
Router reassembly
4 4
To avoid the problems with router reassembly, IP uses destination only reassembly
Wide Area Networks 13
Creates two new datagrams both with the same header fields of the incoming datagram Divides the incoming user data field into two approximately equal portions placing one portion in each new datagram with the constraint that the first portions length is an integer multiple of 64 bits. Sets the data-length of the first new datagram to the number of bits in the first segment, keeping the offset field unchanged. The more-flag is set to 1 Sets the data length of the second new datagram to the number of bits in the second segment, adds the length of the first data portion divided by 8 to the offset field and the more-flag is unchanged Recomputes the Header Checksum in the two new segments
14
IP Datagrams Reassembly
At the destination, the IP layer will reassemble those fragments having the same source and destination addresses, the same protocol type and the same identification fields (together these are called the data unit identifier (ID)) A buffer is used to reassemble the received fragments
4
IP Segmentation Example
Original datagram IP Header
Data length = 472 Segment offset = 0 More = 0
Data payload
4 4 4
Fragments with the same ID would be placed in the correct place in the buffer indicated by the offset field The first datagram must have an offset of 0 The last datagram must have the more-flag set to 0 Once all the segments are received in the buffer, the IP datagram reassembly may take place
Since some segments may not arrive at all, some mechanism must be used to determine when to abandon the reassembly operation
4 4
IP Header
Data payload
IP Header
Data payload
Use of a real-time-clock with a time-out Use the lifetime field of the segment
Data length = 472-240 = 232 (octets) Segment offset = 240/8 = 30 (octets) More = 0
16
IP Addresses
An IP address must be global throughout the Internet. This is assigned by a central authority (called the Network Information Centre, NIC) It consists of two parts
4 4
IP Address Classes
A network address which identifies a subnet A host address which identifies the individual hosts
The number of bits allocated for the network and host addresses is variable. Three different classes are defined
4 4
Class A - Few networks, each with many hosts Class B - Medium number of networks, each with a medium number of hosts Class C - Many networks, each with a few hosts
The Netmask
Sometimes, it is required to change the number of subnets represented by an IP address This may be done through the use of a netmask Example
172.17.125.10 is normally a Class B IP address
Network Host Address Address
However using the netmask 255.255.255.0, it is converted to a Class C address 10101100. 00010001. 01111101. 00001010 (172.17.125.10) 11111111. 11111111. 11111111. 00000000 (255.255.255.0)
Network Address
Wide Area Networks 19
A host machine with a private IP address cannot access the Internet directly, but must do so through a proxy server Within a subnet, the all zero host address is reserved for the network address (e.g. 193.188.36.0) Within a subnet, the all ones host address is reserved for broadcasting (e.g. 193.188.36.255)
Wide Area Networks 20
Commercial organisations Educational institutions (in the USA) Government institutions (in the USA) Military groups (in the USA) (Internet) network support centres Other organisations (in the USA) Internal organisations Malta (and other country codes, like UK, DE etc.)
Wide Area Networks 21
Destination unreachable Time exceeded Parameter problem Source quench Redirect Echo
4 4 4 4 4
Echo reply Timestamp Timestamp reply Address mask request Address mask reply
23
24
ICMP Header
Type (8 bits)
4
Routing
Routing is achieved at the IP layer The problem may be subdivided in
4 4
Specifies the type of ICMP message Used to specify parameters of the messages Checksum of the entire ICMP message Used to specify more lengthy parameters
Code (8 bits)
4
Additional information fields that further specify the content of the message may be included If the ICMP message refers to a previous IP datagram, then the header of the original IP datagram together with the first 64 data bits (which in most cases form part of the TCP header) are also included
this is an internet connected by homogeneous routers, usually under the administrative control of a single entity Routing information inside an autonomous system is communicated using an interior router protocol (IRP) Routing information between two autonomous systems is communicated using an exterior router protocol (ERP) The ERP protocol is simpler than the IRP protocol
Wide Area Networks 26
25
Autonomous Systems
IRP
4
ERP
4
27
28