版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、补充:网络与通信,Our Distributed System Definition,A distributed system is defined as one in which components at networked computers communicate and coordinate their actions only by passing messages. Our interest in distributed systems involves design and implementation, maintenance, study, algorithmic comp
2、onents =a process on a device (PC, PDA) communicate and coordinate =Wired or wireless network,So far,Abstract distributed system collection of processes over a communication medium Protocols/algorithms for synchronization, snapshots, multicast, election, mutual exclusion, failure detectors Will work
3、 in any distributed group of processes E.g., Group of processes on computer hosts E.g., Group of processes on PDAs For most of this course, well focus on (1): computer hosts over the Internet,The Internet (Internet Mapping Project, color coded by ISPs),PCs,routers, switches =nodes,links= edges,网络类型,
4、 Performance: consider two routers connected by a link Latency over the communication link Propagation delay (Lt): the time it takes for the first bit of a packet to reach the destination Data transfer rate (Tr) packet delay = Lt + packet size / Tr Other components of latency Processing delay: the t
5、ime it takes for the OS to process/send/ receive the message. Queuing delay: the time it takes a message to be queued either at end hosts or intermediate nodes while waiting for transmission. Bandwidth: the total amount of information that can be transmitted over a given time. Expressed as messages/
6、second or bytes per second,Networking Issues for DS,Networking Principles,Switching Schemes Broadcast (over a LAN) E.g., IEEE 802.3 - CSMA/CD (Carrier Sense Multiple Access with Collision Detection) E.g., IEEE 802.11a,b,g - WLAN Circuit Switching: a physical circuit is established from the caller to
7、 the callee before communication takes place. E.g., POTS Plain Old Telephone System Packet Switching (a.k.a. store-and-forward): packets that arrive at a node are first stored at the node and then forwarded toward their destinations. E.g., IPv4/IPv6 - Internet Protocol Circuit and Packet switching i
8、ncur the Lt+pkt size/Tr cost on each hop (because each hop stores and forwards entire packet),Networking Principles,Switching Schemes Frame Relay: Similar to store-and-forward, but intermediate nodes route frames based on their first few bits. Frames as a whole are not stored at nodes but pass throu
9、gh the nodes as short streams of bits. E.g., ATM Networks (Asynchronous Transfer Mode) Frame Relay incurs only additional Lt latency on each hop. Packetsize/Tr cost incurred over entire path (with Tr=minimum of link transmission speeds along the path),OSI 7-Layer Protocol Model,Protocol Specifies th
10、e sequence of messages to be exchanged Specifies the format of data in messages,OSI=Open Systems Interconnection,OSI 7-Layer Protocol Summary,Why such a Layering?,Three main reasons Conceptual Simplicity Modularity of code (facilitates writing software for each layer independent of other layers) Pac
11、ket processing well organized The OSI layering organization itself may not be popular, but most networking software is organized as stacks of protocols. E.g., P2P systems - search capability is built on top of ftp, which is on top of sockets.,OSI Reference Model,Each layer performs a well defined fu
12、nction, and provides a well-defined service to the next higher layer. The interface between layer n module and lower layer n-1 module at a node is precisely defined. A layer n module at one end communicates with its peer layer n module at the other end by passing a message into the layer n-1 module
13、(along with necessary information for the lower layer module to generate headers).,Encapsulation of Upper-layer Data,Internet 5-Layer Model,Message Encapsulation - TCP over an Ethernet,Physical Layer,Function: Provides a physical link (bit pipe) for transmitting a sequence of bits between any pair o
14、f connected nodes. Physical interface module (modem) maps the incoming bits from the data link layer into signals appropriate for the channel, and at the receiving end, maps the signals back into bits. Interface module between the data link module and the modem (e.g., RS-232-C interface or X.21 phys
15、ical layer) is responsible for initiating data sending/receipt by providing separate wires between the two modules for control signals.,Data Link Layer,Function: Converts the unreliable bit pipe provided by the physical layer into a virtual communication link for sending packets in an error-free man
16、ner. The sending DL module places some control bits called header at the beginning of each packet and some more overhead bits called trailer at the end of each packet, resulting in a longer string of bits called a frame. Some of these overhead bits perform error detection/correction, and some reques
17、t retransmissions when error occurs. For broadcast links (e.g., Ethernet), there is a need for a new sublayer, called the MAC sublayer, to arbitrate the access to the link so that each node can successfully transmit its frames without interference from the other nodes.,Network Layer,Uses the MAC lay
18、er underneath to transmit packet to the next hop (and eventually towards the destination) Function 1: Addressing Function 2: Routes packets from their sources through the network to their destinations Function 3: Deals with different types of networks, e.g., fragmentation and defragmentation,IP Addr
19、essing (v4),Decimal Representation of Internet Addresses,IP Header,IP Header,IP Packet Layout,IP address allocation problem Network administrators may overestimate (or underestimate) future growth of their networks and request Class B (or Class C) address. Two existing solutions IP v6 Classless inte
20、rdomain routing (CIDR),IPv6 Header Layout,CIDR,Ideas: Allocate a bunch of contiguous class C addresses to a subnet requiring more than 255 addresses. Subdivide a Class B address space for allocation to multiple Class-C subnets. Approaches: Add a mask field a bit pattern to select the portion of an I
21、P address for representing the subnet address and for routing table comparison. For example, a Class C address space can be subdivided into 32 groups of 8 hosts e.g., 48/29: subnet mask is 29 leading 1s followed by 3 0s A given ip address I is in a subnet S if iff when I is ANDed with the
22、 subnet mask of S, it produces the subnet address S.,21,8,Example of Subnet Mask,Does a given ip address belongs to this subnet or not? AND with the subnet mask and see if you get the network id,We have LANs; what are these other“nodes” that connect them?,Hubs connect a LAN to another LAN Simply rep
23、eat packet Highest layer: data link layer Bridges connect different types of networks Translate a packet from one format into another, e.g., Ethernet to optical (FDDI) Highest layer: data link layer (multiple) Switches connect and route between two LANs Routing algorithms Highest layer: network laye
24、r Routers connect and route between two networks Routing algorithms Highest layer: network layer “Tunneling” encapsulate and send an unimplemented protocols packets through from network layer to network layer IPv6 packets can be tunneled through the IPv4 network,How do peer layers talk?,Application
25、message,TCP header,IP header,Ethernet header,Ethernet frame,port,TCP,IP,MAC/Data Link layer match the MAC addresses (48 bits) Network Layer e.g., IP match the IP address (32 bits) Transport Layer e.g., TCP: match the port number (8 bits),MAC,Network,Transport,Application,(Physical),Translation: Who
26、discovers these addresses for the destination?,Port number from the IP address (+ a standard port number) IP address from the resource name/URL (through the DNS) Ethernet address from the IP address (through ARP),ARP: Address Resolution Protocol between IP and Underlying Networks,Most hosts are atta
27、ched to a LAN by an interface board that only understands LAN addresses. For example, every Ethernet board is equipped with a globally unique 48-bit Ethernet address. The boards send and receive frames based on 48-bit Ethernet addresses. They know nothing about the 32-bit IP addresses. Address Resol
28、ution Protocol (ARP) maps the IP addresses onto data link layer addresses (e.g., Ethernet).,ARP Example,ARP,Suppose host 1s IP layer () gets a packet from its transport layer destined for (host 2)? Host 1s IP layer broadcasts an ARP packet onto the Ethernet asking: Who owns IP
29、 address ? Host 2 responds with its Ethernet address (E2). The IP layer on host 1 builds an Ethernet frame addressed to E2, puts the IP packet in the payload field, and transmits it on the Ethernet. The Ethernet board of host 2 detects this frame and causes an interrupt, to deliver the pa
30、cket to the IP layer on host 2. Thus, the packet is transmitted from host 1s IP layer to host 2s IP layer,ARP,The performance of ARP can be improved by caching the broadcast results. Host 1 can include its own IP to Ethernet mapping in the ARP packet.,ARP,Suppose host 1s IP layer () gets
31、a packet from its transport layer with destination address set to (host 4)? Host 1s IP layer broadcasts an ARP packet onto the Ethernet asking: Who owns IP address ? Router E3/F1 responds with its Ethernet address (E3). The IP layer on host 1 transmits an Ethernet frame addres
32、sed to E3 The E3 Ethernet board of router F1 receives the frame and delivers it to the IP layer on F1 F1s IP layer knows from the destination address of in the packet that it has to be next sent to . F1s IP layer sends an ARP on the FDDI ring for IP address . Router
33、 E4/F3 replies. F1s IP layer transmits an FDDI frame (containing the packet) addressed to F3 The FDDI board of F3 receives the frame, and delivers it to the IP layer. F3 knows from the destination address of in the packet that it has to be next sent out to through the interfa
34、ce E4 F3 does an ARP on the EE Ethernet for IP address Host 4 responds with E6 F3 transmits the packet inside an Ethernet frame addressed to E6, and it reaches host 4s IP layer,“Knows” How?,Routing Algorithms! In the Network layer,Routing Algorithms,Programmed in the network layer determ
35、ine the “next hop”, given the destination IP address, thus determine the route for each packet as it travels through the net, dynamically update routing information to reflect failures, changes and congestion. Two approaches: link-state (e.g., OSPF) Every node knows status of each “link” in the netw
36、ork distance-vector (e.g., RIP) Every node knows the next-hop for each possible destination LAN Information maintained as a table Tables updated either Proactively periodically, or Reactively when a neighbor/some link status changes,Distance Vector Routing,Also termed as distributed Bellman-Ford alg
37、orithm or Ford-Fulkerson algorithm, included in RIP (routing information protocol), AppleTalk, and Cisco routers. Each node/router maintains a table indexed by each destination node. Entry gives the best known distance to destination and which link to use for forwarding. Once every T seconds each ro
38、uter sends to each neighbor its own entire table (proactive),Distance Vector Routing,To Link Cost B 1 1 C 1 2 D 3 1 E 1 2 Alocal,To Link Cost A 2 2 B 2 1 D 5 2 E 5 1 C local,Routing Table for A,Routing Table for C,To Link Cost A 1 1 C 2 1 D 4 2 E 4 1 B local,Routing Table for B,Link number (all link
39、s have cost=1),Distance Vector Routing,+, then min across neighbors,Costs only (next hop omitted),Pseudo-Code for RIP,Send: Each t seconds or when Tl changes, send Tl on each non-faulty outgoing link. Receive: Whenever a routing table Tr is received on link n: for all rows Rr in Tr if (Rr.link not e
40、qual n) Rr.cost = Rr.cost + 1; Rr.link = n; if (Rr.destination is not in Tl) add Rr to Tl; / add new destination to Tl else for all rows Rl in Tl if (Rr.destination = Rl.destination and (Rr.cost Rl.cost or Rl.link = n) Rl = Rr; / Rr.cost Rl.cost : remote node has better route / Rl.link = n : remote
41、node is more authoritative ,Link State Routing,Each router must Discover its neighbors and learn their network addresses When a router is booted, it learns who its neighbors are by sending a special Hello packet on each point-to-point link. The router on the other end sends back a reply. Measure the
42、 delay or cost to each of its neighbors A router sends a special Echo packet over the link that the other end sends back immediately. By measuring the round-trip time, the sending router gets a reasonable delay estimate. Construct a packet telling all it has just learned. Broadcast this packet,Link
43、State Routing,A router broadcasts a link-state-advertisement (LSA) packet after booting, as well as periodically (or upon topology change). Packet forwarded only once, TTL-restricted Initial TTL is very high.,Link State Routing,Broadcast the LSA packet to all other routers in the subnet. Each packet
44、 contains a sequence number that is incremented for each new LSA packet sent. Each router keeps track of all the (source router, sequence) pairs it sees. When a new LSA packet comes in, it is checked against the pairs. If the received packet is new, it is forwarded on all the links except the one it
45、 arrived on. The age of each packet is included and is decremented once per time unit. When the age hits zero, the information is discarded. Initial age = very high For routing a packet, since the source knows the entire network graph, it simply computes the shortest path (actual sequence of nodes)
46、locally using the Dijkstras algorithm.,Transport Layer =Transmission Control Protocol,Function 0 provide an application with a connection-oriented view of the network (IP is connectionless) Function 1 (Message decomposition and reassembly): Breaks messages into packets at the transmitting end and re
47、assembles packets into messages at the receiving end. E.g., using identification and fragment offset fields in IPv4 header Function 2 (Multiplexing and demultiplexing): Multiplexes several lower-rate sessions, all from the same source and all going to the same destination, into one session at the ne
48、twork layer. Function 3 (Reliable communication): Provides reliability to the application by acks + retransmissions in an end to end manner Function 4 (End-to-end congestion/flow control): Reduces rate at which data is sent when congestion is detected in the network. (TCP friendliness) All these fun
49、ctionalities are a part of TCP.,Session/Presentation/Application Layers,The session and presentation layers deal with setting up virtual sessions (e.g., SSL), data encryption, data compression etc. The application layer actually does the work required by the users, e.g., FTP, HTTP, p2p. The applicat
50、ion/presentation/session layers are not clearly distinguished in the Internet protocol stack.,DNS: Domain Name System,People: many identifiers: SSN, name, Passport # Internet hosts, routers: IP address (32 bit) - used for addressing datagrams Resource “name”, e.g., URL human-readable for
51、mat Q: given a resource name, how does a client find out the IP address of the service/server?,Domain Name System: distributed database implemented in a hierarchy of many name servers application-layer protocol that is responsible for resolving names (address/name translation),DNS Name Servers,Alter
52、native no server has all name-to-IP address mappings Hierarchy of name servers authoritative name server: for a resource, stores the mapped IP address for that resource local name servers: each institution/company/ISP owns a local (default) name server host DNS query first goes to local name server
53、local name server might be caching an answer,Why not have a central DNS server? single point of failure traffic volume may be far maintenance difficult doesnt scale! (WWW contains several billion pages today),DNS: Root Name Servers,contacted by local name server that can not resolve name root name s
54、erver: contacts authoritative name server if name mapping not known gets mapping returns mapping to local name server dozen root name servers worldwide (as of 98),Simple DNS Example,host surf.eurecom.fr wants IP address of 1. Contacts its local DNS server, dns.eurecom.fr 2. dns.eu
55、recom.fr contacts root name server, if necessary 3. root name server contacts authoritative name server, , if necessary Answer returned by first server that is caching the mapping tuple,requesting host surf.eurecom.fr,,root name server,authoritative name server ,1,2,3,4,5,6,DNS Example,Root name server: may not know the authoritative name server may know intermediate name server: whom to contact to find authoritative name server Hierarchy .
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026事业单位工勤技能-湖北-湖北有线广播电视机务员一级(高级技师)历年参考题库含答案详解
- 2026事业单位工勤技能-湖北-湖北动物检疫员二级(技师)历年参考题库含答案详解
- 2026事业单位工勤技能-海南-海南计算机信息处理员四级中级历年参考题库含答案详解
- 2026事业单位工勤技能-海南-海南机械冷加工五级(初级工)历年参考题库含答案详解
- 2026事业单位工勤技能-海南-海南医技工五级(初级工)历年参考题库含答案详解
- 2026事业单位工勤技能-浙江-浙江行政岗位工四级(中级工)历年参考题库含答案详解
- 2026年单招、对口职业适应性考试题库(含答案)
- 2026年初级税务师税法一章节题库带答案
- 2026年临床常见症状题库(含答案)
- 2026年IT岗位招聘考试题库(含答案)
- 小学道德与法治新部编版五年级上册全册教案(2026秋)
- 驾驶员素质提升培训
- My family幼儿园家庭成员介绍手抄报
- 国家安全教育大学生读本-第一章完全准确领会总体国家安全观
- 2016年公务员国考《申论》真题卷及答案(副省级)
- 《外科学》教案:第七章 麻醉
- 产后康复经络与腧穴
- 2023航标灯光强测量和灯光射程计算
- 《工业机器人技术基础》第5章 工业机器人控制系统课件
- 化工传递过程基础全部
- 边坡滑坡及治理
评论
0/150
提交评论