资源描述
单击此处编辑母版标题样式,单击此处编辑母版文本样式,第二级,第三级,第四级,第五级,*,Computer Networks,*,本资料仅供参考,不能作为科学依据。谢谢。本资料仅供参考,不能作为科学依据。本资料仅供参考,不能作为科学依据。谢谢。本资料仅供参考,不能作为科学依据。,Computer Networks计算机网络,1/105,6/20/2025,1,Computer Networks,时间安排,答疑时间:,18周周三、19周周一,早晨10:00-12:00,期末考试:,19周周三(06月27日)14:00-16:00,厚209,试验:19周周四20周周二,2/105,6/20/2025,2,Computer Networks,What is a Computer Network?,Computer Network is an interconnected collection of autonomous(,自治,)computers connected by a single technology.,The,Internet,is a network of networks.,3/105,6/20/2025,3,Computer Networks,Classification of Networks,by scale,LAN,WAN and MAN,by topology,Bus,Star,Ring and Tree,by switching approach,Circuit switching and Packet switching,by transmission media,Wireless network and Wired network,4/105,6/20/2025,4,Computer Networks,Circuit Switching,电路交换,Link bandwidth,switch capacity,Dedicated resources with no sharing,Guaranteed transmission capacity,Call setup required,End-to-end resources reserved for“call”,5/105,6/20/2025,5,Computer Networks,Circuit Switching,电路交换,Capacity of medium(媒体,介质)exceeds the capacity required for transmission of a single signal,How can we improve“efficiency”?,Lets,multiplex(复用),.,Divide link bandwidth into“pieces”:,FDM(Frequency Division Multiplexing 频分复用),TDM(Time Division Multiplexing 时分复用),6/105,6/20/2025,6,Computer Networks,Circuit Switching:FDM and TDM,FDM,频分多路复用,frequency,time,TDM,时分多路复用,frequency,time,4 users,Example:,partial link,bandwidth,Time slot(时隙),7/105,6/20/2025,7,Computer Networks,Packet Switching,分组交换,source breaks long messages into smaller“packets(,数据包,数据分组,)”,packets,share,network resources,each packet uses full link bandwidth,“store-and-forward(,存放转发,)”transmission,8/105,6/20/2025,8,Computer Networks,A,C,E,B,D,H,1,H,3,H,5,H,6,H,4,H,2,分组交换网示意图,访问结点,用户子网,通信子网,转接结点,链路,9/105,6/20/2025,9,Computer Networks,Packet Switching:Statistical Multiplexing,Sequence of A&B packets does not have fixed pattern,statistical multiplexing,统计多路复用,.,A,B,C,10 Mbs,Ethernet,1.5 Mbs,D,E,statistical multiplexing,Queue(,队列,)of packets waiting for output link,10/105,6/20/2025,10,Computer Networks,How do loss and delay occur?,packets,queue,in router buffers,packet arrival rate to link exceeds output link capacity,packets queue,wait for turn,if queue is full,arriving packets dropped(Drop-Tail),A,B,packet being transmitted,(delay),packets queueing,(delay),free(available)buffers:arriving packets,dropped(,loss,)if no free buffers,11/105,6/20/2025,11,Computer Networks,d,proc,=processing delay(处理时延),typically a few microsecs or less,d,queue,=queuing delay(排队时延),depends on congestion,d,trans,=transmission delay(发送时延),=L/R,significant for low-speed links,d,prop,=propagation delay(传输时延),a few microsecs to hundreds of msecs,Four sources of packet delay,12/105,6/20/2025,12,Computer Networks,Nodal delay,总时延=处理时延+排队时延+发送时延+传输时延,13/105,6/20/2025,13,Computer Networks,Packet switching vs.Circuit switching,Packet switching is great for,bursty data,(突发性数据),resource sharing,Packet switching causes,excessive(额外)congestion,packet delay and loss,protocols needed for reliable data transfer,congestion control,Is packet switching a“slam dunk”winner?,14/105,6/20/2025,14,Computer Networks,Network Architecture,网络体系结构,OSI(Open System Interconnection)is an ISO standard for worldwide communications,The,OSI Reference Model defines a networking framework for implementing protocols in seven layers.,15/105,6/20/2025,15,Computer Networks,The ISO/OSI Reference Models,16/105,6/20/2025,16,Computer Networks,A,protocol,is the special set of rules used to control communication between,entities.,Based on the communication between two entities controlled by protocols,one layer provides,services,to another layer above.,Network Architecture,网络体系结构,17/105,6/20/2025,17,Computer Networks,Relationship between a service and a protocol.,Network Architecture,网络体系结构,18/105,6/20/2025,18,Computer Networks,Application,Presentation,Session,Transport,Network,Data Link,Physical,Application,Presentation,Session,Transport,Network,Data Link,Physical,Physical,Control is passed from one layer to the next,starting at the application layer in one station,proceeding to the bottom layer,over the channel to the next station and back up the hierarchy.,Network Architecture,网络体系结构,19/105,6/20/2025,19,Computer Networks,Physical Layer,how to transmit bits,to the channel,;,Data Link Layer,how to transmit frames,to adjacent,node,(neighbour),over a single link,;,Network Layer,how to route packets,to a host on the other side,across network(s),Network Architecture,网络体系结构,20/105,6/20/2025,20,Computer Networks,Transport Layer,how to send data segments to a process running on another host,across network(s),Session Layer,manage connections,Presentation Layer,encode/decode messages,security,encryption,Application Layer,everything else!,Network Architecture,网络体系结构,21/105,6/20/2025,21,Computer Networks,Comparison:OSI and TCP/IP,Physical,Data Link,Network,Transport,Session,Presentation,Application,Network Interface,IP,Transport,Application,22/105,6/20/2025,22,Computer Networks,TCP/IP Architecture,The TCP/IP Architecture was defined by Internet Engineering Task Force(IETF),Transparent Design,Everything over IP;,IP over Everything;,Best-effort.,FTP,TCP,UDP,IP,NET,1,NET,2,NET,n,HTTP,Multi-,media,TFTP,23/105,6/20/2025,23,Computer Networks,Encapsulation,App.,TCP,IP,Ethernet driver,User Data,User Data,Com.,Application PDU,Application PDU,TcpH,TcpH,IpH,Application PDU,TcpH,IpH,EthH,Eth.T,message,TCP segment,IP packet,Ethernet frame,Ethernet,24/105,6/20/2025,24,Computer Networks,De-capsulation,App.,TCP,IP,Ethernet driver,User Data,User Data,Com.,Application PDU,Application PDU,TcpH,TcpH,IpH,Application PDU,TcpH,IpH,EthH,Eth.T,message,TCP segment,IP packet,Ethernet frame,Ethernet,25/105,6/20/2025,25,Computer Networks,Encapsulation and Demultiplexing,26/105,6/20/2025,26,Computer Networks,Encapsulation and Demultiplexing:Ethernet Header,27/105,6/20/2025,27,Computer Networks,Encapsulation and Demultiplexing:IP Header,28/105,6/20/2025,28,Computer Networks,Encapsulation and Demultiplexing:IP Header,29/105,6/20/2025,29,Computer Networks,Encapsulation and Demultiplexing:TCP Header,Option:,maximum segment size,30/105,6/20/2025,30,Computer Networks,Encapsulation and Demultiplexing:TCP Header,31/105,6/20/2025,31,Computer Networks,Mechanical and electrical specifications,Encoding/Dencoding techniques,Propagation Effects:,Attenuation衰减,Distortion失真,Noise噪音,Interference冲突,The Physical Layer,32/105,6/20/2025,32,Computer Networks,Bandwidth带宽:Capacity of a media to carry information,A channel is a portion of the total bandwidth used for a specific purpose.,Simplex channel 单工信道,Half-duplex channel 半双工信道,Full-duplex channel 全双工信道.,The Physical Layer,33/105,6/20/2025,33,Computer Networks,Wired Transmission Media:,Twisted pair 双绞线,Coaxial cable同轴电缆,Fiber optic cable光缆,Wireless Transmission Media:,radio wave,无线电波,microwave,微波,(including satellite),infrared,红外线,The Physical Layer,34/105,6/20/2025,34,Computer Networks,The data link layer is responsible for efficient reliable communication across a physical link.,LOGICAL LINK sublayer(LLC),MEDIA ACCESS sublayer(MAC),Ethernet (IEEE802.3),Wireless LAN(IEEE802.11),The Data Link Layer,35/105,6/20/2025,35,Computer Networks,The Data Link Layer,OSI,Application,Presentation,Session,Transport,Network,Data Link,Physical,Framing,Error control,Flow control,Transmission/reception of frames,MEDIA ACCESS sublayer,LOGICAL LINK sublayer,36/105,6/20/2025,36,Computer Networks,Sender A,Receiver B,frame1,ack,frame2,重发,frame2,ack,nak,frame3,Data Link Protocols,Protocols in which the sender sends one frame and then waits for an acknowledgement before proceeding are called stop-and-wait.,37/105,6/20/2025,37,Computer Networks,Stop and Wait Protocols,停顿等候协议,Problem:,B sends a NAK frame back to A,after having received a data frame with errors.What happens if A always gets NAK frames.,Solution:,set a max.number for retransmission times,e.g.,8.If not successful,gives an error report to the above layer.,38/105,6/20/2025,38,Computer Networks,Stop and Wait Protocols,停顿等候协议,Problem:,Due to poor link conditions,the frame sent by A doesnt get B at all.It gets lost!In this case,A will never get any,response from the peer.,Solution:,schedule a timeout timer to expire at some time after the ACK should have been returned.If the timer goes off,retransmit the frame.,39/105,6/20/2025,39,Computer Networks,Stop and Wait Protocols,停顿等候协议,Problem:,Retransmissions may introduce duplicate frames received by B,Solution:,assign sequence numbers,序号,for every frame,so that B can distinguish between new frames and old copies.However,an ACK for the duplicated frame is still,necessary!,40/105,6/20/2025,40,Computer Networks,A protocol,in which the sender waits for a positive acknowledgement before advancing to the next data item,are often called,ARQ,(,A,utomatic,R,epeat re,Q,uest).,The ARQ protocol is very simple;,Unfortunately,it gives poor link utilization.,Stop and Wait Protocols,停顿等候协议,41/105,6/20/2025,41,Computer Networks,Stop-and-Wait Protocol Performance,Propagation delay,:,defined as the delay between transmission and receipt of,frame,s between hosts,can be used to estimate timeout period,Frame transmission time,Acknowledgment transmission time,Total delay,(ignoring ACK transmission time):,A,B,42/105,6/20/2025,42,Computer Networks,Of this time,only,t,frame,is actually spent transmitting data.Therefore,the efficiency or utilization is:,If we define,a,:,then,Stop-and-Wait Protocol Performance,43/105,6/20/2025,43,Computer Networks,目标:限制发送方已经发出,但未被确认,数据帧数目。,发送窗口用来控制发送方流量。发送窗口内帧是允许发送帧,而不考虑有没有收到接收方确实认。,0,1,2,3,4,5,6,7,8,9,10,滑动窗口协议,(Sliding Window Protocols),44/105,6/20/2025,44,Computer Networks,0,1,2,3,4,5,6,7,8,9,发送方,接收方,N=5,10,滑动窗口协议,(Sliding Window Protocols),45/105,6/20/2025,45,Computer Networks,发送方,接收方,N=5,0,1,2,3,4,5,6,7,8,9,10,滑动窗口协议,(Sliding Window Protocols),46/105,6/20/2025,46,Computer Networks,0,1,2,3,4,5,6,7,8,9,发送方,接收方,10,N=5,滑动窗口协议,(Sliding Window Protocols),47/105,6/20/2025,47,Computer Networks,PPP,是当前最流行数据链路层协议,PPP is the most popular protocol for the Data link layer,48/105,6/20/2025,48,Computer Networks,Ethernet,以太网,The 802.3 standard describes the operation of the MAC sub-layer in a bus LAN that uses CSMA/CD,Mechanism for Channel Access信道访问机制CSMA/CD,:,C,arrier,S,ense,M,ultiple,A,ccess with,C,ollision,D,etection载波侦听多路存取/碰撞检测,49/105,6/20/2025,49,Computer Networks,CSMA,载波侦听、多路存取,Carrier Sense,:,With carrier sensing,A host will only transmit its own frames when it cannot hear any data being transmitted by other hosts.,Multiple Access,:,Multiple hosts share a single channel,载波侦听,:每个主机在发送数据之前首先监听信道,只有当信道空闲时才发送数据帧;假如信道忙,暂不发送(退避一个随机时间),以免发生碰撞;,多路存取:,多个主机共享信道。,50/105,6/20/2025,50,Computer Networks,CSMA/CD 载波侦听多路存取/冲突检测,CSMA with,Collision Detection,The host always listens to the cable while it is transmitting data.,It aborts transmission as soon as it detects a collision,It tries later again,with a“,binary exponential back-off algorithm,”,冲突检测,:在发送数据过程中一直监听信道,一旦冲突马上中止发送,退避一个随机时间(二进制指数退避算法),再重新发送。,51/105,6/20/2025,51,Computer Networks,Ethernet,以太网,When a host transmits a frame,there is a small chance that a collision will occur,i.e.non-deterministic,不确定性,The frame should be longer enough for sender to detect the collision,52/105,6/20/2025,52,Computer Networks,Ethernet,以太网,This means that the frame must be of a minimum length.,The minimum frame size is related to,the distance which the network spans;,the type of media being used;,the number of repeaters,中继器,which the signal may have to pass through to reach the furthest part of the LAN.,53/105,6/20/2025,53,Computer Networks,Ethernet,以太网,Ethernet defines a minimum frame size,i.e.no frame may have less than 46 bytes of payload.,54/105,6/20/2025,54,Computer Networks,Ethernet Bandwidth,Ethernet:10Mbps,FastEthernet:100Mbps,Gigabit Ethernet:1Gbps,55/105,6/20/2025,55,Computer Networks,Ethernet Cabling,“10”代表信号传输速率为10Mbps。,“BASE”代表是基带信号。,“5”表示每一段电缆最大长度为500m。,“2”表示每一段电缆最大长度为200m(实际上是185m)。,“T”代表双绞线,“”代表光缆,56/105,6/20/2025,56,Computer Networks,Ethernet Cabling,In option of 10Base-T Ethernet Cabling,all stations have a cable running to a central hub,集线器,in which they are all connected electrically.,In this case,the,physical topology,of the LAN is,star,however,the,logical topology,is still,bus,.,57/105,6/20/2025,57,Computer Networks,Ethernet Cabling,Stations must compete the shared channel using CSMA/CD before transmit frames.,Only one station can transmit at a time,Otherwise,a collision will occur!,58/105,6/20/2025,58,Computer Networks,双绞线Ethernet总是和集线器配合使用。,术语:10Base-T Ethernet,“10”代表10Mbit/s数据率。,“T”代表,双绞线星型网,。,用集线器Hub来连接站点。,物理上是星型网,但逻辑上仍是总线网,。各站仍使用CSMA/CD协议,并共享逻辑上总线。,各站必须竞争公共信道,并在任何时刻只有一个站能够发送数据。不然发生碰撞!,Ethernet Cabling,59/105,6/20/2025,59,Computer Networks,Ethernet Extension,At the Physical Layer,Hub集线器,Repeaters中继器,At the Data Link Layer,Bridge(网桥),Switch(交换机),At the Network Layer,Internetworking,60/105,6/20/2025,60,Computer Networks,Wireless LAN,无线局域网,IEEE 802.11 defines CSMA/CA protocol.,CSMA part is the same as in 802.3 Ethernet,CA stands for Collision Avoidance,冲突防止,How CSMA/CA works:,Device wanting to transmit senses the medium(Air),If medium is busy defers,If medium is free for certain period,transmits frame,61/105,6/20/2025,61,Computer Networks,avoid collisions:two or more nodes,transmitting at same time,802.11:CSMA sense(监听)before transmitting,dont collide with ongoing transmission by other node,CSMA/CA,载波监听多路存取/冲突防止,62/105,6/20/2025,62,Computer Networks,802.11 sender,if sense channel idle,for DIFS,then,transmit entire frame(no CD),802.11 receiver,-if frame received OK,return ACK after SIFS(ACK needed due to hidden terminal problem),sender,receiver,DIFS,data,SIFS,ACK,CSMA/CA,载波监听多路存取/冲突防止,63/105,6/20/2025,63,Computer Networks,802.11:,no,collision detection(没有冲突检测)!,cant sense all collisions in any case:hidden terminal隐蔽终端,fading信号衰减,goal:,avoid collisions:,CSMA/C(ollision)A(voidance),A,B,C,A,B,C,As signal,strength,space,Cs signal,strength,CSMA/CA,载波监听多路存取/冲突防止,64/105,6/20/2025,64,Computer Networks,Wireless LAN,无线局域网,By sending Request to Send(RTS),sender is allowed to“reserve”channel rather than random access of data frames:avoid collisions of long data frames,65/105,6/20/2025,65,Computer Networks,Collision Avoidance(,冲突防止,):RTS/CTS exchange,A,B,time,RTS(A),RTS(B),RTS(A),CTS(A),CTS(A),DATA(A),ACK(A),ACK(A),reservation collision,defer,C,66/105,6/20/2025,66,Computer Networks,Infrastructure mode,Access Point,(AP),Internet,IEEE802.11 WLAN,67/105,6/20/2025,67,Computer Networks,Ad Hoc mode,IEEE802.11 WLAN,68/105,6/20/2025,68,Computer Networks,The network layer,based on services provided by the data link layer,provides a end-to-end transparent path for end-to-end transparent data transmission across networks.,The Network Layer,69/105,6/20/2025,69,Computer Networks,The functions of network layer:,Store-and-Forward Packet,数据包存放转发,A host with a packet to send transmits it to the nearest router;,The packet is stored there until it
展开阅读全文