1. Trang chủ
  2. » Công Nghệ Thông Tin

Practical TCP/IP and Ethernet Networking- P22 doc

5 169 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Nội dung

/TZKXTKZRG_KXVXUZUIURY   an IPv4 network address is assigned to an organization, it is done in the form of a 32-bit network address and a corresponding 32-bit mask. The ‘ones’ in the mask cover the NetID, and the ‘zeros’ cover the HostID. The ‘ones’ always run contiguously from the left and are called the prefix. An address of 202.13.3.12 with a mask of 11111111111111111111111111000000 (‘ones’ in the first 26 positions) would therefore be said to have a prefix of 26 and would be written as 202.13.13.12/26. The subnet mask in this case would be 255.255.255.192. Note that this address, in terms of the conventional classification, would have been regarded as a class C address and hence would have been assigned a prefix of /24 (subnet mask with ‘ones’ in the first 24 positions) by default.  )RGYYRKYYOTZKXJUSGOTXU[ZOTM)/*8 A second problem with the fashion in which the IP addresses were allocated by the Network Information Center (NIC), was the fact that it was done more or less at random and that each address had to be advertised individually in the Internet routing tables. Consider, for example, the case of following 4 private (‘traditional’ class C) networks, each one with its own contiguous block of 256 (254 useable) addresses: • Network A: 200.100.0.0 (IP addresses 200.100.0.1–200.100.0.255) • Network B: 192.33.87.0 (IP addresses 192.33.87.1–192.33.87.255) • Network C: 194.27.11.0 (IP addresses 194.27.11.1–194.27.11.255) • Network D: 202.15.16.0 (IP addresses 202.15.16.1–202.15.16.255) Assuming that there are no reserved addresses, then the concentrating router at the ISP would have to advertise 4 × 256 = 1024 separate network addresses. In a real life situation, the ISP’s router would have to advertise tens of thousands of addresses. It would also be seeing hundreds of thousands, if not millions, of addresses advertised by the routers of other ISPs across the globe. In the early nineties the situation was so serious it was expected that, by 1994, the routers on the Internet would no longer be able to cope with the multitude of routing table entries. Figure 6.10 Network advertising with CIDR  6XGIZOIGR:)6/6GTJ+ZNKXTKZ4KZ]UXQOTM   To alleviate this problem, the concept of classless inter-domain routing (CIDR) was introduced. Basically, CIDR removes the imposition of the class A, B and C address masks and allows the owner of a network to ‘supernet’ multiple addresses together. It then allows the concentrating router to aggregate (or ‘combine’) these multiple contiguous network addresses into a single route advertisement on the Internet. Take the same example as before, but this time allocates contiguous addresses. Note that ‘w’ can have any value between 1 and 255 since the address classes are no longer relevant. w x y z Network A: 220.100.0. 0 Network B: 220.100.1. 0 Network C: 220.100.2. 0 Network D: 220.100.3. 0 CIDR now allows the router to advertise all 1000 computers under one advertisement, using the starting address of the block (220.100.0.0) and a CIDR (supernet mask) of 255.255.252.0. This is achieved as follows. As with subnet masking, CIDR uses a mask, but it is less (shorter) than the network mask. Whereas the ‘1’ s in the network mask indicate the bits that comprise the network ID, the ‘1’s in the CIDR (supernet) mask indicates the bits in the IP address that do not change. The total number of computers in this ‘supernet’ can be calculated as follows: Number of ‘1’s in network (subnet) mask = 24 Number of hosts per network = (2 (32-24) – 2) = 2 8 – 2 = 254 Number of ‘1’s in CIDR mask = 22 X= (Number of ‘1’s in network mask – Number of ‘1’s in CIDR mask) = 2 Number of networks aggregated = 2 × X = 2 × 2 = 4 Total number of hosts = 4 × 254 = 1016 Figure 6.11 Network advertising without CIDR /TZKXTKZRG_KXVXUZUIURY   The route advertisement of 220.100.0.0 255.255.252.0 implies a supernet comprising 4 networks, each with 254 possible hosts. The lowest IP address is 220.100.100.1 and the highest is 220.100.3.254. The first mask in the following table (255.255.255.0) is the subnet mask while the second mask (255.255.252.0) is the CIDR mask. Figure 6.12 Binary equivalents of IP addresses and masks used in this example CIDR and the concept of classless addressing go hand in hand since it is obvious that the concept can only work if the ISPs are allowed to exercise strict control over the issue and allocation of IP addresses. Before the advent of CIDR, clients could obtain IP addresses and regard it as their ‘property’. Under the new dispensation, the ISP needs to keep control over its allocated block(s) of IP addresses. A client can therefore only ‘rent’ IP addresses from ISP and the latter may insist on its return, should the client decide to change to another ISP.  /6\NKGJKXYZX[IZ[XK The IP header is appended to the data that IP accepts from higher-level protocols, before routing it around the network. The IP header consists of six 32-bit ‘long words’ and is made up as follows: Figure 6.13 IPv4 header   6XGIZOIGR:)6/6GTJ+ZNKXTKZ4KZ]UXQOTM   <KX HOZY The version field indicates the version of the IP protocol in use, and hence the format of the header. In this case it is 4. /.2 HOZY The Internet header length is the length of the IP header in 32 bit ‘long words’, and thus points to the beginning of the data. This is necessary since the IP header can contain options and therefore has a variable length. The minimum value is 5, representing 5 × 4 = 20 bytes. :_VKULYKX\OIK HOZY The type of service (ToS) field is intended to provide an indication of the parameters of the quality of service desired. These parameters are used to guide the selection of the actual service parameters when transmitting a datagram through a particular network. Some networks offer service precedence, which treats high precedence traffic as more important than other traffic (generally by accepting only traffic above a certain precedence at time of high load). The choice involved is a three-way trade-off between low delay, high reliability, and high throughput. Figure 6.14 Type of service The type of service (ToS) field is composed of a 3-bit precedence field (which is often ignored) and an unused (LSB) bit that must be 0. The remaining 4 bits may only be turned on one at a time, and are allocated as follows: Bit 3: Minimize delay Bit 4: Maximize throughput Bit 5: Maximize reliability Bit 6: Minimize monetary cost RFC 1340 (corrected by RFC 1349) specifies how all these bits should be set for standard applications. Applications such as TELNET and RLOGIN need minimum delay since they transfer small amounts of data. FTP needs maximum throughput since it transfers large amounts of data. Network management (SNMP) requires maximum reliability and usenet news (NNTP) needs to minimize monetary cost. /TZKXTKZRG_KXVXUZUIURY   Most TCP/IP implementations do not support the ToS feature, although some newer implementations of BSD and routing protocols such as OSPF and IS-IS can make routing decisions on it. :UZGRRKTMZN HOZY Total length is the length of the datagram, measured in bytes, including the header and data. Using this field and the header length, it can be determined where the data starts and ends. This field allows the length of a datagram to be up to 2 16 = 65 536 bytes, the maximum size of the segment handed down to IP from the protocol above it. Such long datagrams are, however, impractical for most hosts and networks. All hosts must at least be prepared to accept datagrams of up to 576 octets (whether they arrive whole or in fragments). It is recommended that hosts only send datagrams larger than 576 octets if they have the assurance that the destination is prepared to accept the larger datagrams. The number 576 is selected to allow a reasonable sized data block to be transmitted in addition to the required header information. For example, this size allows a data block of 512 octets plus 64 header octets to fit in a datagram, which is the maximum size permitted by X.25. A typical IP header is 20 octets, allowing some space for headers of higher-level protocols. /JKTZOLOIGZOUT HOZY This number uniquely identifies each datagram sent by a host. It is normally incremented by one for each datagram sent. In the case of fragmentation, it is appended to all fragments of the same datagram for the sake of reconstructing the datagram at the receiving end. It can be compared to the ‘tracking’ number of an item delivered by registered mail or UPS. ,RGMY HOZY There are two flags: • The DF (don’t fragment) flag is set (=1) by the higher-level protocol (e.g. TCP) if IP is NOT allowed to fragment a datagram. If such a situation occurs, IP will not fragment and forward the datagram, but simply return an appropriate ICMP message to the sending host • The MF (more flag) is used as follows. If fragmentation DOES occur, MF=1 will indicate that there are more fragments to follow, whilst MF=0 indicates that it is the last fragment  Figure 6.15 Flag structure . Figure 6.12 Binary equivalents of IP addresses and masks used in this example CIDR and the concept of classless addressing go hand in hand since it is obvious that the concept can only. network address and a corresponding 32-bit mask. The ‘ones’ in the mask cover the NetID, and the ‘zeros’ cover the HostID. The ‘ones’ always run contiguously from the left and are called the. BSD and routing protocols such as OSPF and IS-IS can make routing decisions on it. :UZGRRKTMZN HOZY Total length is the length of the datagram, measured in bytes, including the header and

Ngày đăng: 04/07/2014, 08:21

TỪ KHÓA LIÊN QUAN