通信網(wǎng)絡(luò)技術(shù)課件:chapter5 The Network Layer2_第1頁
通信網(wǎng)絡(luò)技術(shù)課件:chapter5 The Network Layer2_第2頁
通信網(wǎng)絡(luò)技術(shù)課件:chapter5 The Network Layer2_第3頁
通信網(wǎng)絡(luò)技術(shù)課件:chapter5 The Network Layer2_第4頁
通信網(wǎng)絡(luò)技術(shù)課件:chapter5 The Network Layer2_第5頁
已閱讀5頁,還剩152頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、Computer NetworksRoadmapIntroductionPhysical LayerData Link LayerTransport LayerNetwork LayerMedium Access SublayerApplication Layer2The Network LayerChapter 5What you will learn:5.1 Network layer design issues5.2 Routing algorithms5.3 Congestion control algorithms5.4 Quality of service5.5 Internetw

2、orking5.6 The Networking layer in the internetThe Network Layer is concerned about getting packets from source to destination, no matter how many hops it may take. Its all about routing . The network layer is the lowest layer that deals with end-to-end transmission. 45.5 InternetworkingHow Networks

3、DifferHow Networks Can Be ConnectedConcatenated Virtual CircuitsConnectionless InternetworkingTunnelingInternetwork RoutingFragmentation5Internetworkinginternet: connection of two or more networksThe Internet, the more generic term, is made up of a hodgepodge(大雜燴) of different hardware and protocols

4、.Multiple networks and multiple network types (protocols) are a fact of life.TCP/IP, IBMs SNA, ATM, Novell NCP/IPX, AppleTalk, Wireless6Why many different networks The installed base of different networks is large.As computers and networks get cheaper, the place where decisions get made moves downwa

5、rd in organizations.New technology will undoubtedly bring new networks and new protocols7Connecting NetworksA collection of interconnected networks.8Internetworking in a connection-oriented environmentInternetworking using concatenated virtual circuits.9Connectionless InternetworkingA connectionless

6、 internet.10Internetworking DevicesRepeaters, hubs (physical layer)They just move the bits from one network to an identical network. These are mostly analog devices and do not understand anything about digital protocols (they just regenerate signals).Bridges and Switches (data link layer)They can ac

7、cept frames, examine the MAC addresses, and forward the frames to a different network while doing minor protocol translation in the process.11Internetworking DevicesRouters (network layer)They can connect two networks (fully aware of different network technologies), if two networks have dissimilar n

8、etwork layer, the router may be able to translate between the packet formats.Transport Gateway (transport layer)For example, a transport gateway could allow packets to flow between a TCP network and an SNA network, which has a different transport protocol, by essentially gluing a TCP connection to a

9、n SNA connection. 12Internetworking DevicesApplication Gateway (above transport layer)application gateways translate message semantics. As an example, gateways between Internet e-mail (RFC 822) and X.400 e-mail must parse the e-mail messages and change various header fields. 13Switch versus Router(a

10、) Two Ethernets connected by a switch. (b) Two Ethernets connected by routers.14The essential differenceAn essential difference between the switched (or bridged) case and the routed case is this: With a switch (or bridge), the entire frame is transported on the basis of its MAC address. With a route

11、r, the packet is extracted from the frame and the address in the packet is used for deciding where to send it. Switches do not have to understand the network layer protocol being used to switch packets. Routers do.15Multiprotocol RoutersProtocol Routers are packet switches that operate at the networ

12、k layer. Operating at the network level gives routers increased flexibility compared to bridges in terms of: Translating addresses between dissimilar networks. Fragmenting large packets for transmission across networks that carry only small maximum packet lengths. Selecting an appropriate path throu

13、gh the subnet. Enforcing policies (e.g., dont forward any local packets off of this network). Because routers do more work than bridges, they generally run slower than bridges. Can use routers and gateways interchangeably or think of routers as within a subnet (same network) versus gateways (between

14、 subnets). 16the reality isnt so simply layered - many products combine bridge and router functionality.17How Networks DifferSome of the many ways networks can differ.18ProblemsIssues that must be dealt with:Networks with different networks protocols are tough to translate between. This is rarely at

15、tempted. (See tunneling below.)Addressing - when adjacent networks have differing address schemes, the going gets tough. Again, problems are generally insurmountable(不能克服).19TunnelingTunneling is a special case between two same-type networks across intervening foreign network(s). The whole packet is

16、 encapsulated in the protocol of the foreign network to be crossed, and then restored on the other side. This avoids, totally, trying to translate the packet.20TunnelingTunneling a packet from Paris to London.21Tunneling AnalogyTunneling a car from France to England.22FragmentationEach network impos

17、es some maximum size on its packets. These limits have various causes, among them: Hardware (e.g., the size of an Ethernet frame).Operating system (e.g., all buffers are 512 bytes).Protocols (e.g., the number of bits in the packet length field).Compliance with some (inter)national standard.Desire to

18、 reduce error-induced retransmissions to some level.Desire to prevent one packet from occupying the channel too long.23FragmentationHow to cross networks whose maximum transmission unit (MTU) is smaller than the packet being transmitted.Connection-oriented internets avoid this problem. By selecting

19、a maximum packet size at connection set up time. That maximum is just min( MTU1, MTU2, .) of the MTUs in the intervening network. Once the connection is established, the path never changes, so the sender can select a packet size and never again worry that it will be too large. In connectionless inte

20、rnets, the appropriate packet size depends on the path used. Thus, it can change at any time. 24SolutionsIn the general case, setting a minimum MTU for all networks is impractical. A minimum MTU would of necessity be small, yet sending larger packets should be encouraged for efficiency reasons.Solut

21、ions: Have router drop packets that are too large to send across a network and return an error message to the sender. The sending host could then retransmit the data in a smaller packet. Have router fragment large packets into several fragments, each small enough to traverse the network. There are t

22、wo flavors called Transparent and non-Transparent Fragmentation.25Fragmentation(a) Transparent fragmentation. (b) Nontransparent fragmentation.26Transparent FragmentationTransparent Fragmentation (ATM works this way)With transparent fragmentation, end hosts (sender and receiver) are unaware that fra

23、gmentation has taken place. A router fragments a packet, and the next-hop router on the same network reassembles the fragments back into the original packet. Drawbacksthe exit gateway must know when it has received all the pieces .All fragments must travel through to the same router. They must all b

24、e reassembled by the same next-hop router.the overhead required to repeatedly reassemble and then refragment a large packet passing through a series of small-packet networks. 27Non-Transparent FragmentationNon-Transparent Fragmentation (IP works this way):As before, routers fragment packets when nee

25、ded. Routers along the path do not reassemble. Destination hosts perform re-assembly (if needed). Downsides are:it requires every host to be able to do reassembly Overhead of carrying along small segments lasts until destination (because each fragment must have a header ).285.6 The Network Layer in

26、the InternetThe IP ProtocolIP AddressesInternet Control ProtocolsOSPF The Interior Gateway Routing ProtocolBGP The Exterior Gateway Routing ProtocolInternet MulticastingMobile IPIPv629Communication in the InternetThe transport layer takes data streams and breaks them up into datagrams. In theory, da

27、tagrams can be up to 64 Kbytes each, but in practice they are usually not more than 1500 bytes (so they fit in one Ethernet frame). Each datagram is transmitted through the Internet, possibly being fragmented into smaller units as it goes. When all the pieces finally get to the destination machine,

28、they are reassembled by the network layer into the original datagram. This datagram is then handed to the transport layer, which inserts it into the receiving process input stream. 30The IP ProtocolIP (Internet Protocol)Network layer protocol of the Ivide a best-efforts (unreliable, conne

29、ctionless) way to transport datagrams from source to destination, without regard to whether these machines are on the same network or whether there are other networks in between them. 31TCP/IP Protocol StackFTP, Telnet, HTTP,TCP, UDPIP, ICMP,IGMP,ARP,RARP,BOOTP,DHCPDefined by other standard.Ethernet

30、, 802.11, ApplicationLayerTransportLayerNetworkLayerHost-to-NetworkLayer32Protocol Data Unit EncapsulationTCP/IP over EthernetApplicationTCPIPEthernet DriverEthernetTransmissionLineEthernetHeaderIPHeaderTCPHeaderApplicationDataEthernetTrailer14 Bytes4 Bytes20 Bytes20 BytesVariable Length46 to 1500By

31、tesIPHeaderTCPHeaderApplicationDataTCPHeaderApplicationDataApplicationHeaderUser DataUser DataApplication MessageTCP SegmentIP Packet (Datagram)Ethernet Frame33The IP Datagram FormatThe IPv4 (Internet Protocol) header.34The IP Datagram FormatVersion number (4-bits): The current protocol version is 4

32、.Including a version number allows a future version of IP be used along side the current version, facilitating migration to new protocols.IHL: Header length (4-bits): Length of the datagram header (excluding data) in 32-bit words. The minimum length is 5 words = 20 bytes, but can be up to 15 words i

33、f options are used. In practice, the length field is used to locate the start of the data portion of the datagram. 35The IP Datagram FormatType-of-service (8-bits): A hint to the routing algorithms as to what type of service we desire. Precedence (3-bits): A priority indication, where 0 is the lowes

34、t and means normal service, while 7 is highest and is intended for network control messages (e.g., routing, congestion control). Delay (1-bit): An Application can request low delay service (e.g., for interactive use). Throughput (1-bit): Application requests high throughput. Reliability (1-bit): App

35、lication requests high reliability. Note: In practice, routers ignore the TOS field in IPV4. IETF threw in the towel and changed the field slightly to accommodate differentiated services. Six of the bits are used to indicate which of the service classes discussed earlier each packet belongs to. Thes

36、e classes include the four queueing priorities, three discard probabilities, and the historical classes. 36The IP Datagram FormatTotal length (16-bits): Max=65535 bytesTotal length of the IP datagram (in bytes), including data and header. The size of the data portion of the datagram is the total len

37、gth minus the size of the header. Identificationallow the destination host to determine which datagram a newly arrived fragment belongs to. All the fragments of a datagram contain the same Identification value. 37The IP Datagram FormatUnused (1 bit)DF (Dont Fragment , 1bit )It is an order to the rou

38、ters not to fragment the datagram because the destination is incapable of putting the pieces back together again. MF (More Fragments, 1bit) All fragments except the last one have this bit set. It is needed to know when all fragments of a datagram have arrived. 38The IP Datagram FormatFragment offset

39、 (13 bits)The offset field shows order of the fragments.All fragments except the last one in a datagram must be a multiple of 8 bytes, the elementary fragment unit. Since 13 bits are provided, there is a maximum of 8192 fragments per datagram, giving a maximum datagram length of 65,536 bytes, one mo

40、re than the Total length field. Example:Original Frame:IHL = 5, Length = 656, Fragment Offset = 0, More = 0Fragment 1:IHL = 5, Length = 252, Fragment Offset = 0, More = 1Fragment 2:IHL = 5, Length = 252, Fragment Offset = 29, More = 1Fragment 3:IHL = 5, Length = 192, Fragment Offset = 58, More = 039

41、The IP Datagram FormatTTL (Time to Live, 8 bits)A counter that is decremented by each gateway. Should this hopcount reach 0, discard the datagram. Originally, the time-to-live field was intended to reflect real time (up to 255 sec). In practice, it is now a hopcount. The time-to-live field squashes

42、looping packets.Most systems set TTL=30 40The IP Datagram FormatProtocol (8-bits): What type of data the IP datagram carries (e.g., TCP, UDP, etc.). Needed by the receiving IP to know the higher level service that will next handle the data.The numbering of protocols is global across the entire Inter

43、net ( ). ICMP 00000001IGMP 00000010TCP 00000110UDP 0001000141The IP Datagram FormatHeader Checksum (16-bits):A checksum of the IP header ONLY.The IP checksum is computed as follows: Treat the data as a stream of 16-bit words (appending a 0 byte if needed). Compute the 1s complement sum of the 16-bit

44、 words. Take the 1s complement of the computed sum. This checksum is much weaker than the CRCs we have studied. But, it has the property that the order in which the 16-bit words are summed is irrelevant.We can place the checksum in a fixed location in the header, set it to zero, compute the checksum

45、, and store its value in the checksum field. On receipt of a datagram, the computed checksum calculated over the received packet should be zero. Check summing only the header reduces the processing time at each gateway, but forces transport layer protocols to perform error detection (if desired). Th

46、e header must be recalculated at every router since the time_to_live field is decremented.42The IP Datagram FormatSource address (32-bits): Original senders address. This is an IP address, not a MAC address.Destination address (32-bits): Datagrams ultimate destination. The IP embedded datagram conta

47、ins the source of the original sender (not the forwarding gateway) and the destination address of the ultimate destination. 43The IP Datagram Format IP OptionsIP datagrams allow the inclusion of optional, varying length fields that need not appear in every datagram. We may sometimes want to send spe

48、cial information, but we dont want to dedicate a field in the packet header for this purpose. Options start with a 1-byte option code, followed by zero or more bytes of option data.The option code byte contains three parts: copy flag (1 bit): If 1, replicate option in each fragment of a fragmented d

49、atagram. That is, this option should appear in every fragment as well. If 0, option need only appear in first fragment. option class (2 bits): Purpose of option: 0 = network control 1 = reserved 2 = debugging and measurement 3 = reserved44The IP Datagram FormatSome of the IP options./assignments/ip-

50、parameters 5-54option number (5 bits): A code indicating the options type. 45IP AddressesAddresses consist of 32-bit identifiers. Internet software translates names into addresses and addresses into names; lower protocol layers always uses addresses rather than names. Address encodes its network num

51、ber and host number. The combination is unique: in principle, no two machines on the Internet have the same IP address 46IP AddressesNetwork numbers are managed by a nonprofit corporation called ICANN (Internet Corporation for Assigned Names and Numbers) to avoid conflicts. In turn, ICANN has delega

52、ted parts of the address space to various regional authorities, which then dole out IP addresses to ISPs and other companies. Over 500,000 networks are now connected to the Internet, and the number grows every year. 47IP AddressesIP address: 32-bit identifier for host, router interface Interface: co

53、nnection between host/router and physical linkrouters typically have multiple interfaceshost may have multiple interfacesIP addresses associated with each interface7 = 11011111 00000001 00000001 0000000122311148IP AddressesNetwork addresses, which are 32-bit numbers, are usually written in dotted de

54、cimal notation. In this format, each of the 4 bytes is written in decimal, from 0 to 255. For example, the 32-bit hexadecimal address C0290614 is written as 0. The lowest IP address is and the highest is 55. 49Classful AddressingIP address formats.Class A : 128 networks with 16 million hosts eachCla

55、ss B : 16,384 networks with up to 64K hosts eachClass C: 2 million networks (e.g., LANs) with up to 256 hosts each50Special IP addresses.Special IP addresses.51Classful AddressingInternet addresses are hierarchical addresses. Datagrams are initially routed only by network number.Only the gateway con

56、nected to the destination network uses the local part while performing the routing operation. 52Classful AddressingWhat happens to a hosts internet address if that host moves from one network to another? Its Internet address must change. Its important to distinguish between a machines name and its a

57、ddress. Physical (ethernet) address is constant, network (IP) address may change. 53SubnetsAll the hosts in a network must have the same network number. This property of IP addressing can cause problems as networks grow. The problem is the rule that a single class A, B, or C address refers to one ne

58、twork, not to a collection of LANs. 54SubnetsA campus network consisting of LANs for various departments.55SubnetsSubnet addressing is a technique that allows a set of multiple, interconnected networks to be covered by a single IP network number. IP addresses have a well-defined structure that allow

59、s a gateway to extract the network portion of an address by simply looking at its class and an optional netmask.56SubnetsWith subnetting, the local part of an IP address is further subdivided into a network and a host partTo implement subnetting, hosts and gateways use a subnet mask to extract the n

60、etwork part of an IP address 57Subnet MaskA class B network subnetted into 64 subnets.Mask: / 2214 bits6 bits10 bits58SubnetsConsider two addresses and Are they on the same network? NO. When sending data to , local gateways first route datagrams to the (sub)network 130.50.12 rather than (IP network)

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論