Sie sind auf Seite 1von 7

TCP/IP

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

Differences between TCP/IP and the OSI 7-layer model


Number of layers
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

Functions performed at a given layer


4 4

Windows NT/95/98 Unix

Interface between adjacent layers


4

Wide Area Networks

TCP/IP Protocol Architecture


Application Layer Transport Layer Internet Layer Network Access Layer Physical Layer

Some Protocols in the TCP/IP protocol suite

Wide Area Networks

Wide Area Networks

Protocol Data Units

The Internet Protocol (IP)

The IP datagram header (variable length)


Wide Area Networks 5 Wide Area Networks 6

IP Header Fields
Version (4 bits)
4

IP Header Fields (cont)


Identification (16 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

Internet Header Length, IHL (4 bits)


4

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

Type of Service (8 bits)


4

Dont Fragment bit


used to indicate to the network not to fragment this IP datagram if this bit is set and the underlying network does not support the given datagram size, then the given datagram would be discarded

Total Length (16 bits)


4

The third bit is not defined


Wide Area Networks 8

IP Header Fields (cont)


Fragment offset (13 bits)
4

IP Header Fields (cont)


Header Checksum (16 bits)
4 4 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

Source Address (32 bits)


4

Protocol (8 bits)
4

Destination Address (32 bits)


4 4

Time-to-live (8 bits)
4

Wide Area Networks

10

IP Header Fields (cont)


Options (variable length)
4

Fragmentation and Reassembly


Individual subnetworks within an internet may specify different maximum packet size It is not practical and efficient to harmonise the packet size since different network access protocols have different requirements Thus routers may need to segment incoming datagrams into smaller fragments This may occur a number of times within an internet Reassemble of the segments may be performed
4 4

Used to encode various options requested by the source, such as


Security options. The data field may be encrypted for example Source routing. The list of router addresses through which the datagram must be routed. This may be used for security reasons, for instance Route recording. Each router used to route a datagram is inserted in this field. This may be used for network management or source routing Stream identification. May indicate that data part is carrying real-time information Time stamp. Used to record the time at which a datagram passes through each router. Used for network management

Padding (variable length)


4

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)

Data (variable length, multiple of 8 bits)


Wide Area Networks 11 Wide Area Networks 12

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

Wide Area Networks

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

Segmentation into two datagrams

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 = 240 (multiple of 8) (octets) Segment offset = 0 More = 1


15

Data length = 472-240 = 232 (octets) Segment offset = 240/8 = 30 (octets) More = 0
16

Wide Area Networks

Wide Area Networks

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 IP address is normally expressed in the dotted notation, e.g. 193.188.36.7


Wide Area Networks 17 Wide Area Networks 18

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

Private and Special Addresses


In order to simplify the assignment of IP addresses, a range of IP addresses have been defined to be private, i.e. their use in the Internet is not unique
4 4 4

10.0.0.0 172.16.0.0 192.168.0.0

10.255.255.255 172.31.255.255 192.168.255.255

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

Domain Name System


In order to simplify the IP addressing scheme to humans, a domain name system is used, whereby an IP address is mapped to a dotted name, e.g. 193.188.36.7 rohan.eng.um.edu.mt A domain name server (DNS) maps the domain name to an IP address One IP address may be mapped to more than one domain name The domain name is partitioned into several domain levels separated by a dot (.) The common top level domains are
4 4 4 4 4 4 4 4

Address Resolution Protocol (ARP)


The IP layer communicates to its peers through the network access layer (or the MAC layer) If the destination IP address is in the same subnet as the source, then the datagram may be sent directly to the destination The ARP maintains a local routing table consisting of MAC/IP address pairs When the destination IP address is on the same subnet, the MAC address of the destination is directly obtained from this table and communication is possible When the destination IP address is not on the same subnet, the datagram must be addressed to a router connected to the local network
Wide Area Networks 22

COM EDU GOV MIL NET ORG INT MT

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

The Internet Control Message Protocol (ICMP)


Any IP implementation must also implement ICMP It provides the mechanisms whereby hosts and routers may exchange network messages necessary to maintain the correct operation of the network ICMP messages include the following
4 4 4 4 4 4

ICMP Message Formats

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

Wide Area Networks

23

Wide Area Networks

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

Checksum (16 bits)


4

Host routing Routing between routers

Parameters (32 bits)


4

To simplify the routing in the Internet, an autonomous system is defined


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

Wide Area Networks

25

Autonomous Systems
IRP
4

Standard Routing Protocols


Most widely used protocol is the Routing Information Protocol (RIP) A newer (and better) protocol is the Open Shortest Path First (OSPF) protocol The standard ERP used in TCP/IP internets is the Border Gateway Protocol (BGP)

ERP
4

Wide Area Networks

27

Wide Area Networks

28

Das könnte Ihnen auch gefallen