Presentation is loading. Please wait.

Presentation is loading. Please wait.

Univ. of TehranWireless Ad Hoc/Sensor Networks1 Computer Network on Graduate level University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser.

Similar presentations


Presentation on theme: "Univ. of TehranWireless Ad Hoc/Sensor Networks1 Computer Network on Graduate level University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser."— Presentation transcript:

1 Univ. of TehranWireless Ad Hoc/Sensor Networks1 Computer Network on Graduate level University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser Yazdani & Farshad Lahouti Review of Computer Networking Lecture 2: Review of Computer Networking

2 Univ. of TehranComputer Network2 A tour of networking Goal and objective needs design requirement Whirlwind tour of networking

3 Univ. of TehranComputer Network3 Information, Computers and Networks Information: anything that is represented in bits Form (can be represented) vs substance (cannot) Properties: Infinitely replicable Computers can “manipulate” information Networks create “access” to information Potential of networking: move bits everywhere, cheaply, and with desired performance characteristics Break the space barrier for information

4 Univ. of TehranComputer Network4 Objective of Networking ? Direct or indirect access to every other node in the network Connectivity is the magic needed to communicate if you do not have a link. Must understand many connection factors Traffic data rate Traffic pattern (bursty or constant bit rate) Traffic target (multipoint or single destination, mobile or fixed) Application requirements, Delay sensitivity Loss sensitivity.

5 Univ. of TehranComputer Network5 Another view Building a network to support diverse ranges of applications Distributed computing. Multimedia. Telecommunication. E-commerce, etc. What kind of technology do we need? Hardware. Software.

6 Univ. of TehranComputer Network6 What is a Network? What is computer Network? Different views. Differences from other networks, Its generality. What is requirements? Different perspective: Network provider Network designer Application programmer

7 Univ. of TehranComputer Network7 Design goals Connectivity Scalability Simplicity For designers. Most importantly for users. Efficiency cost performance Support for common user services.

8 Univ. of TehranComputer Network8 Levels of Networking Communicating across a link, LANs. Connecting together multiple links (Bridges) Finding and routing data to nodes on Internet. Communicating on the application level, matching application requirements

9 Univ. of TehranComputer Network9 A First Step Creating a link between nodes Link: path followed by bits Wired or wireless Broadcast or point-to-point (or both) Node: any device connected to a link

10 Univ. of TehranComputer Network10 Types of Links Point-to-PointMultiple Access …

11 Univ. of TehranComputer Network11 Packet Transmission Modes Unicast Transmission to single specific receiver Broadcast Transmission to all network nodes Multicast Transmission to specific subset of nodes Anycast Transmission to one of a specific subset of nodes

12 Univ. of TehranComputer Network12 Back in the Old Days…

13 Univ. of TehranComputer Network13 Then Came TDM… Multiplex (mux)Demultiplex (demux) Synchronous time division multiplexing

14 Univ. of TehranComputer Network14 TDM Logical Network View

15 Univ. of TehranComputer Network15 Packet Switching (Internet) Packets

16 Univ. of TehranComputer Network16 Switched Network What are Switched Networks? Switch: moves bits between links Packet switching Circuit switching

17 Univ. of TehranComputer Network17 Packet Switching Interleave packets from different sources Efficient: resources used on demand Statistical multiplexing General Multiple types of applications Accommodates bursty traffic Addition of queues

18 Univ. of TehranComputer Network18 Statistical Multiplexing Gain 1 Mbps link; users require 0.1 Mbps when transmitting; users active only 10% of the time Circuit switching: can support 10 users Packet switching: with 35 users, probability that >=10 are transmitting at the same time < 0.0017

19 Univ. of TehranComputer Network19 Characteristics of Packet Switching Store and forward Packets are self contained units Can use alternate paths - reordering Contention Congestion Delay

20 Univ. of TehranComputer Network20 Internet[work] Second Step: Internet[work] A collection of interconnected networks Host: network endpoints (computer, PDA, light switch, …) Router: node that connects networks Internet vs. internet

21 Univ. of TehranComputer Network21 Challenge Many differences between networks Address formats Performance – bandwidth/latency Packet size Loss rate/pattern handling Routing How to translate between various network technologies

22 Univ. of TehranComputer Network22 Third Step: How To Find Nodes? internet Computer 1Computer 2

23 Univ. of TehranComputer Network23 Naming Humans use readable host names E.g. www.cmu.eduwww.cmu.edu Globally unique (can correspond to multiple hosts) Naming system translates to physical address E.g. DNS translates name to IP Address (e.g. 128.2.11.43) Address reflects location in network

24 Univ. of TehranComputer Network24 Domain Name System What’s the IP address for www.cmu.edu? It is 128.2.11.43 DNS server address manually configured into OS Local DNS ServerComputer 1

25 Univ. of TehranComputer Network25 Packet Routing/Delivery Each network technology has different local delivery methods Address resolution provides delivery information within network E.g., ARP maps IP addresses to Ethernet addresses Local, works only on a particular network Routing protocol provides path through an internetwork

26 Univ. of TehranComputer Network26 Network:Address Resolution Protocol Ethernet Broadcast: who knows the Ethernet address for 128.2.11.43? Ethernet Broadcast: Yes, it is 08-00-2c-19-dc-45

27 Univ. of TehranComputer Network27 Internetwork: Datagram Routing R R R R R H H H H R R H R Routers send packet to next closest point H: Hosts R: Routers

28 Univ. of TehranComputer Network28 Routing Forwarding tables at each router populated by routing protocols. Original Internet: manually updated Routing protocols update tables based on “cost” Exchange tables with neighbors or everyone Use neighbor leading to shortest path

29 Univ. of TehranComputer Network29 Fourth Step: Application Demands Reliability Corruption Lost packets Flow and congestion control Fragmentation In-order delivery Etc…

30 Univ. of TehranComputer Network30 What if the Data gets Corrupted? Internet GET windex.htmlGET index.html Solution: Add a checksum Problem: Data Corruption 0,996,7,8214,571,2,36 X

31 Univ. of TehranComputer Network31 What if the Data gets Lost? Internet GET index.html Problem: Lost Data Internet GET index.html Solution: Timeout and Retransmit GET index.html

32 Univ. of TehranComputer Network32 What if Network is Overloaded? Problem: Network Overload Short bursts: buffer What if buffer overflows? Packets dropped and retransmitted Sender adjusts rate until load = resources Called “Congestion control” Solution: Buffering and Congestion Control

33 Univ. of TehranComputer Network33 Problem: Packet size Solution: Fragment data across packets What if the Data Doesn’t Fit? On Ethernet, max IP packet is 1.5kbytes Typical web page is 10kbytes GETindex.html GET index.html

34 Univ. of TehranComputer Network34 Solution: Add Sequence Numbers Problem: Out of Order What if the Data is Out of Order? GETx.thindeml GET x.thindeml GET index.html ml4inde2x.th3GET1

35 Univ. of TehranComputer Network35 Network Functionality Summary Link Multiplexing Routing Addressing/naming (locating peers) Reliability Flow control Fragmentation Etc….

36 Univ. of TehranComputer Network36 What is Layering? Modular approach to network functionality The idea of divide and conquer Use abstraction to hide complexity. Example: Link hardware Host-to-host connectivity Application-to-application channels Application

37 Univ. of TehranComputer Network37 Protocols Module in layered structure Set of rules governing communication between network elements (applications, hosts, routers) Protocols define: Interface to higher layers (API) Interface to peer Format and order of messages Actions taken on receipt of a message

38 Univ. of TehranComputer Network38 Protocols Building blocks of a network architecture Each protocol object has two different interfaces service interface: operations on this protocol peer-to-peer interface: messages exchanged with peer Term “protocol” is overloaded specification of peer-to-peer interface module that implements this interface

39 Univ. of TehranComputer Network39 Layering Characteristics Each layer relies on services from layer below and exports services to layer above Interface defines interaction Hides implementation - layers can change without disturbing other layers (black box)

40 Univ. of TehranComputer Network40 Layering Host Application Transport Network Link User AUser B Layering: technique to simplify complex systems

41 Univ. of TehranComputer Network41 Layer Encapsulation Get index.html Connection ID Source/Destination Link Address User AUser B

42 Univ. of TehranComputer Network42 Protocol Demultiplexing Multiple choices at each layer FTPHTTPTFTPNV TCPUDP IP NET 1 NET 2 NET n … TCP/UDPIP IPX Port Number Network Protocol Field Type Field

43 Univ. of TehranComputer Network43 E.g.: OSI Model: 7 Protocol Layers Physical: how to transmit bits Data link: how to transmit frames Network: how to route packets Transport: how to send packets end2end Session: how to tie flows together Presentation: byte ordering, security Application: everything else

44 Univ. of TehranComputer Network44 OSI Layers and Locations Switch Router Host Application Transport Network Data Link Presentation Session Physical

45 Univ. of TehranComputer Network45 Physical Layer Dealing with Transmission/Receiving bits. Encoding digital data, 0 & 1, on the signal NRZ, Manchester coding Framing Error Detection CRC, checksum Error Correction- Reliable data Transmission FEC- Forward Error Correction ARQ- Automatic Repeat Request, Stop & wait,..

46 Univ. of TehranComputer Network46 Stop and Wait Time Packet ACK Timeout Simplest ARQ protocol Send a packet, stop and wait until acknowledgement arrives Use sequence number to recognize repeat SenderReceiver

47 Univ. of TehranComputer Network47 How to Keep the Pipe Full? Send multiple packets Number of pkts in flight = window How large a window is needed Round trip delay * bandwidth = capacity of pipe Reliable, unordered delivery Several parallel stop & waits Send new packet after each ack After Nack Go back N Resent the Nacked packet only

48 Univ. of TehranComputer Network48 Data Link Layer Three or more machines are physically connected and communicating. Problems: How to connect them? Topology Sharing links How to address each machine? Addressing How to regulate accessing to the media? MAC (Media Access method or protocol) Collision! Different LAN technology Ethernet ~85 Token Ring ~12

49 Univ. of TehranComputer Network49 Goals of MAC Protocols MAC Protocols arbitrate access to a common shared channel among a population of nodes Goals: 1. Fair among users 2. High efficiency 3. Low delay 4. Fault tolerant 5- Simple

50 Univ. of TehranComputer Network50 Multiplexing/Media Access/Sharing Partition the channel and give everybody a time/freq slot FDMA CDMA: (Code Division Multiple Access) Different codes TDMA Taking turn Token Ring Random Access ALOHA CSMA, etc Reservation Based access or Centralized arbiter

51 Univ. of TehranComputer Network51 Examples of MAC Protocols Packet-Switched Radio Network Aloha Carrier Sense Multiple Access/Collision Detection Ethernet (IEEE 802.3) Token Passing Token Ring (IEEE 802.5) Fiber Distributed Data Interface (FDDI) Simple Random Complex Deterministic Wireless

52 Univ. of TehranComputer Network52 Internetworking Communication between networks. Problems & Challenges Different Networking technologies (Heterogeneity). So many Networks (Scaling). Some terminologies: “internetworking” refer to an arbitrary collection of connected networks. “Internet” the global internetwork. “Network” either directly connected or switched network using any LAN technology such as Ethernet, Token ring, ATM, etc.

53 Univ. of TehranComputer Network53 Goals 0 Connect existing networks initially ARPANET and ARPA packet radio network 1. Survivability - ensure communication service even in the presence of network and router failures 2. Support multiple types of services 3. Must accommodate a variety of networks 4. Allow distributed management 5. Allow host attachment with a low level of effort 6. Allow resource accountability

54 Univ. of TehranComputer Network54 IP Layering (Principle 8) Relatively simple Router Host Application Transport Network Link

55 Univ. of TehranComputer Network55 Common View of the Telco Network Brick

56 Univ. of TehranComputer Network56 Common View of the IP Network

57 Univ. of TehranComputer Network57 Needs some intelligence! routing

58 Univ. of TehranComputer Network58 IP Internet Concatenation of Networks or “networks of Networks”. “R” is routers and “H” is hosts. R2 R1 H4 H5 H3 H2 H1 Network 2 (Ethernet) Network 1 (Ethernet) H6 Network 3 (FDDI) Network 4 ( point-to-point) H7R3H8

59 Univ. of TehranComputer Network59 Service Model Connectionless (datagram-based) Best-effort delivery (unreliable service) packets are lost. No recover from lost. packets are delivered out of order duplicate copies of a packet are delivered packets can be delayed for a long time Datagram format VersionHLen TOSLength IdentFlagsOffset TTL Protocol Checksum SourceAddr DestinationAddr Options (variable) Pad (variable) 0 4 816 1931 Data Contains all information for routing!

60 Univ. of TehranComputer Network60 IP Address Classes (Some are Obsolete) Network IDHost ID Network IDHost ID 816 Class A 32 0 Class B 10 Class C 110 Multicast Addresses Class D 1110 Reserved for experiments Class E 1111 24

61 Univ. of TehranComputer Network61 Forwarding vs. Routing Forwarding: the process of moving packets from input to output The forwarding table Lookup. How to populate the lookup table? Routing: process by which the forwarding table is built and maintained One or more routing protocols Procedures (algorithms) to convert routing info to forwarding table.

62 Univ. of TehranComputer Network62 Original IP Route Lookup Address classes A: 0 | 7 bit network | 24 bit host (16M each) B: 10 | 14 bit network | 16 bit host (64K) C: 110 | 21 bit network | 8 bit host (255) We need to keep only network address, 2 21 entries. Address would specify prefix for forwarding table Simple lookup

63 Univ. of TehranComputer Network63 CIDR Revisited Supernets Assign adjacent net addresses to same org Classless routing (CIDR) How does this help routing table? Combine routing table entries whenever all nodes with same prefix share same hop

64 Univ. of TehranComputer Network64 What is Routing? R3 A B C R1 R2 R4D E F R5 F R3E D Next HopDestination D

65 Univ. of TehranComputer Network65 What is Routing? R3 A B C R1 R2 R4D E F R5 F R3E D Next HopDestination D 16 32 41 Data Options (if any) Destination Address Source Address Header ChecksumProtocolTTL Fragment Offset Flags Fragment ID Total Packet LengthT.ServiceHLenVer 20 bytes

66 Univ. of TehranComputer Network66 What is Routing? A B C R1 R2 R3 R4D E F R5

67 Univ. of TehranComputer Network67 How do we set up Routing Tables? Graph theory to compute “shortest path” Switches = nodes Links = edges Delay, hops = cost Need to adapt to changes in topology

68 Univ. of TehranComputer Network68 Factors Affecting Routing 4 3 6 2 1 9 1 1 Routing algorithms view the network as a graph Problem: find the lowest cost path between two nodes Factors Static topology Dynamic load Policy D A F E B C

69 Univ. of TehranComputer Network69 Internet Routing Internet organized as a two level hierarchy First level – autonomous systems (AS’s) AS – region of network under a single administrative domain AS’s run an intra-domain routing protocols Distance Vector, e.g., Routing Information Protocol (RIP) Link State, e.g., Open Shortest Path First (OSPF) Between AS’s runs inter-domain routing protocols, e.g., Border Gateway Routing (BGP) De facto standard today, BGP-4

70 Univ. of TehranComputer Network70 Example AS-1 AS-2 AS-3 Interior router BGP router

71 Univ. of TehranComputer Network71 Transport Layer First end-to-end layer End-to-end state May provide reliability, flow and congestion control

72 Univ. of TehranComputer Network72 Why End-to-End Protocols? Underlying best-effort network drop messages re-orders messages delivers duplicate copies of a given message limits messages to some finite size delivers messages after an arbitrarily long delay multiple application processes on each host Different speed of sender and receiver (Flow control) Congestion in the network (Congestion controls) Initially, there was no end to end protocol.

73 Univ. of TehranComputer Network73 User Datagram Protocol (UDP) Minimal Transport Service: Port addressing: for application multiplexing Error detection (Checksum): formerly optional Connectionless end-to-end datagram service No flow control. No error recovery (no acks) Used by SNMP, DNS, TFTP, RTP, RPC, etc Source Port Dest Port Check- sum Length 16 Size in bits16

74 Univ. of TehranComputer Network74 TCP Communication abstraction: Connection oriented, Point to point Reliable Error Detection and correction Ordered Byte-stream Application writes bytes TCP sends segments Application reads bytes Full duplex, two way connection Flow and congestion controlled Protocol implemented entirely at the ends Fate sharing

75 Univ. of TehranComputer Network75 What’s Different From Link Layers? Logical link vs. physical link Must establish connection Variable RTT May vary within a connection Reordering packets How long can packets live  max segment lifetime Can’t expect endpoints to exactly match link Buffer space availability Packets in transmission, delay X bandwidth Transmission rate Don’t directly know transmission rate

76 Univ. of TehranComputer Network76 TCP Header Source portDestination port Sequence number Acknowledgement Advertised windowHdrLen Flags 0 ChecksumUrgent pointer Options (variable) Data Flags: SYN FIN RESET PUSH URG ACK

77 Univ. of TehranComputer Network77 TCP Flow Control TCP is a sliding window protocol For window size n, can send up to n bytes without receiving an acknowledgement When the data is acknowledged then the window slides forward Each packet advertises a window size Indicates number of bytes the receiver has space for Original TCP always sent entire window Congestion control now limits this

78 Univ. of TehranComputer Network78 TCP Congestion Control Underlying design principle: packet conservation, Make load udaptable At equilibrium, inject packet into network only when one is removed Reaching equilibrium Slow start Eliminates spurious retransmissions Accurate RTO estimation Fast retransmit Adapting to resource availability Congestion avoidance

79 Univ. of TehranComputer Network79 TCP Congestion Control Basics Keep a congestion window, cwnd Denotes how much network is able to absorb Sender’s maximum window: Min (advertised window, cwnd) Sender’s actual window: Max window - unacknowledged segments If we have large actual window, should we send data in one shot? No, use acks to clock sending new data

80 Univ. of TehranComputer Network80 Self-clocking PrPr PbPb ArAr AbAb Receiver Sender AsAs

81 Univ. of TehranComputer Network81 Slow Start How do we get this clocking behavior to start? Initialize cwnd = 1 Upon receipt of every ack, cwnd = cwnd + 1 Implications Window actually increases to W in RTT * log 2 (W) Can overshoot window and cause packet loss

82 Univ. of TehranComputer Network82 Slow Start Example 1 One RTT One pkt time 0R 2 1R 3 4 2R 5 6 7 8 3R 9 10 11 12 13 14 15 1 23 4567

83 Univ. of TehranComputer Network83 Congestion Window Time Congestion Window Slow start with each time out

84 Univ. of TehranComputer Network84 Congestion Avoidance Loss implies congestion – why? Not necessarily true on all link types If loss occurs when cwnd = W Network can handle 0.5W ~ W segments Set cwnd to 0.5W (multiplicative decrease) Upon receiving ACK Increase cwnd by 1/cwnd Results in additive increase

85 Univ. of TehranComputer Network85 Return to Slow Start If packet is lost we lose our self clocking as well Need to implement slow-start and congestion avoidance together When timeout occurs set ssthresh to 0.5w If cwnd < ssthresh, use slow start Else use congestion avoidance

86 Univ. of TehranComputer Network86 Fast Retransmit Don’t wait for window to drain Resend a segment after 3 duplicate ACKs remember a duplicate ACK means that an out-of sequence segment was received Notes: duplicate ACKs due to packet reordering why reordering? window may be too small to get duplicate ACKs ACK 2 segment 1 cwnd = 1 cwnd = 2 segment 2 segment 3 ACK 4 cwnd = 4 segment 4 segment 5 segment 6 segment 7 ACK 3 3 duplicate ACKs ACK 4

87 Univ. of TehranComputer Network87 Fast Recovery Each duplicate ack notifies sender that single packet has cleared network When < cwnd packets are outstanding Allow new packets out with each new duplicate acknowledgement Behavior Sender is idle for some time – waiting for ½ cwnd worth of dupacks Transmits at original rate after wait Ack clocking rate is same as before loss

88 Univ. of TehranComputer Network88 Fast Recovery

89 Univ. of TehranComputer Network89 Fast Recovery Time Sequence No Sent for each dupack after W/2 dupacks arrive

90 Univ. of TehranComputer Network90 Is Layering Harmful? Sometimes.. Layer N may duplicate lower level functionality (e.g., error recovery) Layers may need same info (timestamp, MTU) Strict adherence to layering may hurt performance

91 Univ. of TehranComputer Network91 Performance Metrics Bandwidth (throughput) data transmitted per time unit link versus end-to-end notation KB = 2 10 bytes Mbps = 10 6 bits per second Latency (delay) time to send message from point A to point B one-way versus round-trip time (RTT) components Latency = Propagation + Transmit + Queuing Queuing time can be a dominant factor

92 Univ. of TehranComputer Network92 Latency Latency ( Queuing Delay) Host A Host B R1 R2 R3 TRANSP 1 TRANSP 2 TRANSP 3 TRANSP 4 PROP 1 PROP 2 PROP 3 PROP 4 Q2Q2 The egress link might not be free, packets may be queued in a buffer. If the network is busy, packets might have to wait a long time. How can we determine the queuing delay?

93 Univ. of TehranComputer Network93 Queues and Queuing Delay Cross traffic causes congestion and variable queuing delay.

94 Univ. of TehranComputer Network94 A router queue  A(t), D(t) Model of router queue Q(t) Buffer Server

95 Univ. of TehranComputer Network95 D(t) A(t) time Q(t) d(t) Queue occupancy: Q(t) = A(t) - D(t). Queuing delay, d(t), is the time spent in the queue by a bit that arrived at time t, and if the queue is served first-come-first-served (FCFS or FIFO) Simple deterministic model Cumulative number of bits

96 Univ. of TehranComputer Network96 Time evolution of a queue Packets  A(t), D(t) Model of FIFO router queue Q(t) time Packet Arrivals: Departures: Q(t)

97 Univ. of TehranComputer Network97 Little’s Result

98 Univ. of TehranComputer Network98 Next: Internet Design Principle What are the main consideration in designing Internet How TCP/IP protocol has been designed References Design Philosophy of the DARPA Internet Protocols End-to-end Arguments in System Design


Download ppt "Univ. of TehranWireless Ad Hoc/Sensor Networks1 Computer Network on Graduate level University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser."

Similar presentations


Ads by Google