1 / 153

COMPUTER NETWORKS

COMPUTER NETWORKS. Chapter 1 8 Internet Protocols. Protocol Functions. Small set of functions that form basis of all protocols Not all protocols have all functions Reduce duplication of effort May have same type of function in protocols at different levels Encapsulation( 封装 )

Download Presentation

COMPUTER NETWORKS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. COMPUTER NETWORKS Chapter 18 Internet Protocols

  2. Protocol Functions Small set of functions that form basis of all protocols Not all protocols have all functions Reduce duplication of effort May have same type of function in protocols at different levels Encapsulation(封装) Fragmentation and reassembly (分片和重装) Connection control (连接控制) Ordered delivery (顺序交付) Flow control (流量控制) Error control (差错控制) Addressing (寻址) Multiplexing (复用) Transmission services (传输服务)

  3. Encapsulation Data usually transferred in blocks Protocol data units (PDUs) Each PDU contains data and control information Some PDUs only control Three categories of control (三类控制字段) Address Of sender and/or receiver Error-detecting code E.g. frame check sequence Protocol control Additional information to implement protocol functions Addition of control information to data is encapsulation(在数据外添加控制信息称之为封装) Data accepted or generated by entity and encapsulated into PDU Containing data plus control information e.g. TFTP, HDLC, frame relay, ATM, AAL5 (Figure 11.15), LLC, IEEE 802.3, IEEE 802.11

  4. Fragmentation and Reassembly(Segmentation – OSI) Exchange data between two entities Characterized as sequence of PDUs of some bounded size Application level message in the form of datagram or continuous data stream Reason: Lower-level protocols may need to break data up into smaller blocks Communications network may only accept blocks of up to a certain size ATM 53 octets Ethernet 1526 octets IEEE802.11 2304 octets More efficient error control Smallerretransmission Fairer(公平) Prevent station monopolizing medium(防止长期霸占) Smaller buffers Provision of checkpoint and restart/recovery operations

  5. Disadvantages of Fragmentation Make PDUs as large as possible because  PDU contains some control information(分割都要加控制信息) Smaller block, larger overhead PDU arrival generates interrupt Smaller blocks, more interrupts More time processing smaller, more numerous PDUs

  6. Reassembly Segmented data must be reassembled into messages More complex if PDUs out of order

  7. PDUS and Fragmentation(Copied from chapter 2 fig 2.4)

  8. Connection Control Connectionless data transfer(无连接的传输) Each PDU treated independently E.g. datagram(数据报) Connection-oriented data transfer(面向连接的传输) E.g. virtual circuit(虚电路) Connection-oriented preferred (even required) for lengthy exchange of data Logical association, or connection, established between entities Three phases occur  Connection establishment Data transfer Connection termination May be interrupt and recovery phases to handle errors

  9. Phases of Connection Oriented Transfer

  10. Connection Establishment Entitiesagree to exchange data Typically, one station issues connection request Receiving entity accepts or rejects (simple) May include negotiation Syntax, semantics, and timing(语法、语义、定时) Both entities must use same protocol May allow optional features Must be agreed E.g. protocol may specify max PDU size 8000 octets; one station may wish to restrict to 1000 octets

  11. Data Transfer and Termination Both data and control information exchanged e.g. flow control, error control Data flow and acknowledgements may be in one or both directions One side may send termination request Or central authority might terminate

  12. Sequencing Many connection-oriented protocols use sequencing e.g. HDLC, IEEE 802.11 PDUs numbered sequentially (给数据报编序列号) Each side keeps track of outgoing and incoming numbers Supports three main functions Ordered delivery Flow control Error control Not found in all connection-oriented protocols E.g.frame relay and ATM All connection-oriented protocols include some way of identifying connection Unique connection identifier Combination of source and destination addresses

  13. Ordered Delivery PDUs may arrive out of order Different paths through network PDU order must be maintained Number PDUs sequentially Easy to reorder received PDUs Finitesequence number field(有限的序列号字段) Numbers repeat modulo maximum number(以最大序列号为模) Maximum sequence number greater than maximum number of PDUs that could be outstanding(序列号的最大值要比未经确认的PDU的最大数量要大) In fact, maximum number may need to be twice maximum number of PDUs that could be outstanding e.g. selective-repeat ARQ(在选择重发ARQ中,序列号必须是窗口大小的两倍)

  14. Flow Control Performedby receiving entity to limit amount or rate of data sent Stop-and-wait Each PDU must be acknowledged before next sent Credit(信贷) Amount of data that can be sent without acknowledgment E.g. HDLC sliding-window Must be implemented in several protocols Network traffic control Buffer space Application overflow E.g. waiting for disk access

  15. Error Control Guard against loss or damage Error detection and retransmission Sender inserts error-detecting code in PDU Function of other bits in PDU Receiver checks code on incoming PDU If error, discard If transmitter doesn’t get acknowledgment in reasonable time, retransmit Error-correction code Enables receiver to detect and possibly correct errors Error control is performed at various layers of protocol Between station and network Inside network

  16. Addressing Addressing level(寻址级别) Addressing scope (寻址范围) Connection identifiers (连接表示符) Addressing mode (寻址方式)

  17. TCP/IP Concepts

  18. Addressing Level Level in comms architecture at which entity is named Unique address for each end system e.g. workstation or server And each intermediate system (e.g., router) Network-level address IP address or internet address OSI - network service access point (NSAP) Used to route PDU through network At destination data must routed to some process Each process assigned an identifier TCP/IP port Service access point (SAP) in OSI

  19. Addressing Scope Global address Global nonambiguity(全局唯一) Identifies unique system Synonyms permitted(允许有同义字,系统可能有多个全局地址) Global applicability(全局适用性) Possible at any global address to identify any other global address, in any system, by means of global address of other system(通过使用系统中的的全局地址,任何系统的全局地址都能被全局访问) Enables internet to route data between any two systems Need unique address for each device interface on network MAC address on IEEE 802 network and ATM host address Enablesnetwork to route data units through network and deliver to intended system Network attachment point address Addressing scope only relevant for network-level addresses (地址的范围通常仅对网络级地址而言是重要的) Port or SAP above network level is unique within system Need not be globally unique

  20. Connection Identifiers Entity 1 on system A requests connection to entity 2 on system B, using global address B.2. B.2 accepts connection (通常是一个编号) Connection identifier used by both entities for future transmissions Reduced overhead Generally shorter than global identifiers Routing Fixed route may be defined Connection identifier identifies route to intermediate systems Multiplexing Entity may wish more than one connection simultaneously PDUs must be identified by connection identifier Use of state information(连接有状态信息) Once connection established, end systems can maintain state information about connection Flow and error control using sequence numbers

  21. Addressing Mode Usually address refers to single system or port Individual or unicast (单播) address Address can refer to more than one entity or port Multiple simultaneous recipients for data Broadcast for all entities within domain Multicast for specific subset of entities

  22. Multiplexing Multiple connections into single system(多个连接进入一个系统) E.g. frame relay, can have multiple data link connections terminating in single end system Connections multiplexed over single physical interface Can also be accomplished via port names Also permit multiple simultaneous connections E.g. multiple TCP connections to given system Each connection on different pair of ports

  23. Multiplexing Between Levels Upward or inward multiplexing(上行/内复用) Multiple higher-level connections share single lower-level connection More efficient use of lower-level service Provides several higher-level connections where only single lower-level connection exists Downward multiplexing, or splitting(下行/分裂) Higher-level connection built on top of multiple lower-level connections Traffic on higher connection divided among lower connections Reliability, performance, or efficiency.(可以提高可靠性、性能或效率)

  24. Transmission Services Protocol may provide additional services to entities E.g.: Priority Connection basis On message basis E.g. terminate-connection request Quality of service E.g. minimum throughput or maximum delay threshold Security Security mechanisms, restricting access These services depend on underlying transmission system and lower-level entities

  25. 互联网与因特网 • 互连在一起的网络要进行通信,会遇到许多问题需要解决,如: • 不同的寻址方案 • 不同的最大分组长度 • 不同的网络接入机制 • 不同的超时控制 • 不同的差错恢复方法 • 不同的状态报告方法 • 不同的路由选择技术 • 不同的用户接入控制 • 不同的服务(面向连接服务和无连接服务) • 不同的管理与控制方式

  26. 网络互相连接起来要使用一些中间设备 • 中间设备又称为中间系统或中继(relay)系统。 • 物理层中继系统:转发器(repeater)。 • 数据链路层中继系统:网桥或桥接器(bridge)。 • 网络层中继系统:路由器(router)。 • 网桥和路由器的混合物:桥路器(brouter)。 • 网络层以上的中继系统:网关(gateway)。

  27. 网络互连使用路由器 • 当中继系统是转发器或网桥时,一般并不称之为网络互连,因为这仅仅是把一个网络扩大了,而这仍然是一个网络。 • 网关由于比较复杂,目前使用得较少。 • 互联网都是指用路由器进行互连的网络。 • 由于历史的原因,许多有关 TCP/IP的文献将网络层使用的路由器称为网关。

  28. 互连网络与虚拟互连网络 路由器 网络 网络 虚拟互连网络 (IP 网) 网络 网络 网络 (a) 互连网络 (b) 虚拟互连网络

  29. 虚拟互连网络的意义 • 所谓虚拟互连网络也就是逻辑互连网络,它的意思就是互连起来的各种物理网络的异构性本来是客观存在的,但是我们利用 IP 协议就可以使这些性能各异的网络从用户看起来好像是一个统一的网络。 • 使用 IP 协议的虚拟互连网络可简称为 IP 网。 • 使用虚拟互连网络的好处是:当互联网上的主机进行通信时,就好像在一个网络上通信一样,而看不见互连的各具体的网络异构细节。

  30. IP Operation

  31. The Internet as a Network

  32. Design Issues(非面向连接互联方式的设计问题) Routing Datagram lifetime Fragmentation and re-assembly Error control Flow control

  33. Routing End systems and routers maintain routing tables Indicate next router to which datagram should be sent Static May contain alternative routes(替换路由) Dynamic Flexible response to congestion and errors Source routing Source specifies route as sequential list of routers to be followed Security Priority Route recording(每个路由器将自己的互联网地址附加到数据报中一列地址的后面)

  34. Datagram Lifetime Datagrams could loop indefinitely Consumes resources Transport protocol may need upper bound on datagram life(运输协议需要需要数据报生存期有个上限) Datagram marked with lifetime Time To Live field in IP Once lifetime expires, datagram discarded (not forwarded) Hop count Decrement time to live on passing through a each router Time count(另一种方式是用精确的时间计时) Need to know how long since last router

  35. Fragmentation and Re-assembly Different packet sizes When to re-assemble At destination Results in packets getting smaller as data traverses internet Intermediate re-assembly Need large buffers at routers Buffers may fill with fragments All fragments must go through same router Inhibits dynamic routing

  36. IP Fragmentation IP re-assembles at destination only Uses fields in header Data Unit Identifier (ID) Identifies end system originated datagram Data length Length of user data in octets Offset Position of fragment of user data in original datagram In multiples of 64 bits (8 octets) More flag Indicates that this is not the last fragment

  37. Fragmentation Example

  38. Dealing with Failure Re-assembly may fail if some fragments get lost Need to detect failure Re-assembly time out Assigned to first fragment to arrive If timeout expires before all fragments arrive, discard partial data Use packet lifetime (time to live in IP) If time to live runs out, kill partial data

  39. Error Control Not guaranteed delivery Router should attempt to inform source if packet discarded e.g. for time to live expiring Source may modify transmission strategy May inform high layer protocol Datagram identification needed

  40. Flow Control Allows routers and/or stations to limit rate of incoming data Limited in connectionless systems Send flow control packets Requesting reduced flow e.g. ICMP

  41. 名词 internet 和 Internet • 以小写字母 i 开始的 internet(互联网或互连网)是一个通用名词,它泛指由多个计算机网络互连而成的虚拟网络。 • 以大写字母 I 开始的的 Internet(因特网)则是一个专用名词,它指当前全球最大的、开放的、由众多网络相互连接而成的特定计算机网络,它采用TCP/IP协议族,且其前身是美国的 ARPANET。

  42. 因特网的网际协议 IP 网际协议 IP 是 TCP/IP 体系中两个最主要的协议之一 。与 IP 协议配套使用的还有四个协议: • 地址解析协议 ARP (Address Resolution Protocol) • 逆地址解析协议 RARP (Reverse Address Resolution Protocol) • 因特网控制报文协议 ICMP (Internet Control Message Protocol) • 因特网组管理协议 IGMP (Internet Group Management Protocol)

  43. 网际协议 IP 及其配套协议 各种应用层协议 应用层 (TELNET, FTP, SMTP 等) TCP, UDP 运输层 ICMP IGMP 网际层 IP RARP ARP 与各种网络接口 网络接口层 物理硬件

  44. 分类的 IP 地址--IP 地址及其表示方法 • 我们把整个因特网看成为一个单一的、抽象的网络。IP 地址就是给每个连接在因特网上的主机(或路由器)分配一个在全世界范围是惟一的 32 bit 的标识符。 • IP 地址现在由因特网名字与号码指派公司ICANN (Internet Corporation for Assigned Names and Numbers)进行分配

  45. IP 地址的编址方法 • 分类的 IP 地址。这是最基本的编址方法,在 1981 年就通过了相应的标准协议。 • 子网的划分。这是对最基本的编址方法的改进,其标准[RFC 950]在 1985 年通过。 • 构成超网。这是比较新的无分类编址方法。1993 年提出后很快就得到推广应用。

  46. 分类 IP 地址 • 每一类地址都由两个固定长度的字段组成,其中一个字段是网络号 net-id,它标志主机(或路由器)所连接到的网络,而另一个字段则是主机号 host-id,它标志该主机(或路由器)。 • 两级的 IP 地址可以记为: IP 地址 ::= { <网络号>, <主机号>} (6-1) ::= 代表“定义为”

  47. host-id 8 bit IP 地址中的网络号字段和主机号字段 0 A 类地址 net-id 8 bit host-id 24 bit 1 0 B 类地址 net-id 16 bit host-id 16 bit C 类地址 1 1 0 net-id 24 bit 1110 D 类地址 多 播 地 址 11110 E 类地址 保 留 为 今 后 使 用

  48. host-id 8 bit IP 地址中的网络号字段和主机号字段 0 A 类地址 net-id 8 bit host-id 24 bit 1 0 B 类地址 net-id 16 bit host-id 16 bit C 类地址 1 1 0 net-id 24 bit A 类地址的网络号字段 net-id 为 1 字节 1110 D 类地址 多 播 地 址 11110 E 类地址 保 留 为 今 后 使 用

  49. host-id 8 bit IP 地址中的网络号字段和主机号字段 0 A 类地址 net-id 8 bit host-id 24 bit 1 0 B 类地址 net-id 16 bit host-id 16 bit C 类地址 1 1 0 net-id 24 bit B 类地址的网络号字段 net-id 为 2 字节 1110 D 类地址 多 播 地 址 11110 E 类地址 保 留 为 今 后 使 用

  50. host-id 8 bit IP 地址中的网络号字段和主机号字段 0 A 类地址 net-id 8 bit host-id 24 bit 1 0 B 类地址 net-id 16 bit host-id 16 bit C 类地址 1 1 0 net-id 24 bit C 类地址的网络号字段 net-id 为 3 字节 1110 D 类地址 多 播 地 址 11110 E 类地址 保 留 为 今 后 使 用

More Related