mohmmad khalily dermany islamic azad university. reference اصول مهندسي اينترنت...

86
Networking Mohmmad Khalily Dermany Islamic Azad University

Upload: piper-chaney

Post on 16-Dec-2015

226 views

Category:

Documents


4 download

TRANSCRIPT

  • Slide 1
  • Mohmmad Khalily Dermany Islamic Azad University
  • Slide 2
  • Reference
  • Slide 3
  • What is Layering? Modular approach to network functionality The idea of divide and conquer Use abstraction to hide complexity. Example: TCP/IP, OSI, ? Link hardware (PHY, Internet interface) Host-to-host connectivity (internet) Application-to-application channels (Transport) Application
  • Slide 4
  • TCP/IP Layering Relatively simple Router Host Application Transport Network Link
  • Slide 5
  • 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
  • Slide 6
  • First: Network Interface or PHY 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 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!
  • Slide 7
  • PHY (cont.) Dealing with Transmission/Receiving bits. Encoding digital data, 0 & 1, on the signal Modulation and Demodulation Digital to Digital or Analog Framing Media Access Control Error Detection CRC, checksum Error Correction- Reliable data Transmission FEC- Forward Error Correction ARQ- Automatic Repeat Request, Stop & wait,..
  • Slide 8
  • 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
  • Slide 9
  • Circuit SwitchingMessage Switching Packet Switching / Cell Switching
  • Slide 10
  • Circuit Switching Establishing and adjusting the circuit (setup a connection) Data transmission (busy intermediate switches) Terminating the connection (releasing intermediate switches) Disadvantages Considerable time to establish a connection The impossibility of communicating with the two machines and intermediate switches by other machines when transmitter and receiver channels being busy by two machines
  • Slide 11
  • BCD A Connection request Connection reply Data transmission disconect
  • Slide 12
  • Message Switching Digital data Permanent connection to each station with its own switching center Adding some information to the data before sending it into switching center by station central switch receive message completely and then select the appropriate output channel based on receiver address Advantage Non busy Faster ?!
  • Slide 13
  • Transmissi on delay Message Switching A B C Processing latency
  • Slide 14
  • Disadvantage Message length subject Need large memory in switches Retransmission of data on a bit fault Excessive delay on data transmission Volume of messages at once Store & forward vs. cut through
  • Slide 15
  • Packet Switching / Cell Switching Divided each messages into smaller fragments, Added some information to reconstruct the message at the receiver Decrease total delay Packets and cells have constant length and are small
  • Slide 16
  • BCD A Packet Switching / Cell Switching
  • Slide 17
  • Comparison between cell and message switching ?
  • Slide 18
  • B C D A BCD A
  • Slide 19
  • Multiplexing 1 Mbps link; users require 0.1 Mbps when transmitting; users active only 10% of the time Packet switching: with 35 users, probability that >=10 are transmitting at the same time < 0.0017
  • Slide 20
  • Back in the Old Days
  • Slide 21
  • Then Came TDM Multiplex (mux)Demultiplex (demux) Synchronous time division multiplexing
  • Slide 22
  • Multiplexing Static Dynamic Statistical multiplexing Multiplexing FDM (Frequency Division Multiplexing) TDM (Time Division Multiplexing)
  • Slide 23
  • TDM Logical Network View
  • Slide 24
  • Packet Switching (Internet) Packets
  • Slide 25
  • TDM
  • Slide 26
  • FDM
  • Slide 27
  • 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
  • Slide 28
  • MAC Protocols Centralized Access point in Wireless Distributed Token based Token Ring Token Bus Random access ALOHA CSMA, CSMA/CD CSMA/CA, etc.
  • Slide 29
  • MAC Protocols Partition the channel and give everybody a time/freq slot FDMA TDMA SDMA: (Space Division Multiple Access) CDMA: (Code Division Multiple Access) Reservation Based access or Centralized arbiter
  • Slide 30
  • 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
  • Slide 31
  • Flow Control Time Packet ACK Timeout Stop and Wait Simplest ARQ protocol Send a packet, stop and wait until acknowledgement arrives Use sequence number to recognize repeat SenderReceiver
  • Slide 32
  • Flow Control (cont.) 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
  • Slide 33
  • Others about PHY MAC address Modulation Analog to Analog Analog to Digital Digital to Analog Digital to Digital Why Modulation?
  • Slide 34
  • Second: Internetwork A collection of interconnected networks Host: network endpoints (computer, PDA, switch, ) Router: node that connects networks Internet vs. internet Internetwork
  • Slide 35
  • 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.
  • Slide 36
  • Goals Connect existing networks initially ARPANET and ARPA packet radio network Survivability - ensure communication service even in the presence of network and router failures Support multiple types of services Must accommodate a variety of networks Allow distributed management Allow host attachment with a low level of effort Allow resource accountability
  • Slide 37
  • Challenge Many differences between networks Address formats Performance bandwidth/latency Packet size Loss rate/pattern handling Routing How to translate between various network technologies
  • Slide 38
  • 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
  • Slide 39
  • 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!
  • Slide 40
  • 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
  • Slide 41
  • 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 (254) We need to keep only network address, 2 21 entries. Address would specify prefix for forwarding table Simple lookup
  • Slide 42
  • 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
  • Slide 43
  • 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 Hierarchical routing
  • Slide 44
  • What is Routing? Univ. of TehranComputer Network44 R3 A B C R1 R2 R4D E F R5 F R3E D Next HopDestination D
  • Slide 45
  • 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
  • Slide 46
  • What is Routing? A B C R1 R2 R3 R4D E F R5
  • Slide 47
  • 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
  • Slide 48
  • Factors Affecting Routing Routing algorithms view the network as a graph Problem: find the lowest cost path between two nodes Factors Static topology Dynamic load Policy 4 3 6 2 1 9 1 1 D A F E B C
  • Slide 49
  • Internet Routing Internet organized as a two level hierarchy First level autonomous systems (ASs) AS region of network under a single administrative domain ASs run an intra-domain routing protocols Distance Vector, e.g., Routing Information Protocol (RIP) Link State, e.g., Open Shortest Path First (OSPF) Between ASs runs inter-domain routing protocols, e.g., Border Gateway Routing (BGP) De facto standard today, BGP-4
  • Slide 50
  • Example AS-1 AS-2 AS-3 Interior router BGP router
  • Slide 51
  • How To Find Nodes? internet Computer 1Computer 2
  • Slide 52
  • Naming Humans use readable host names E.g. www.srbiau.ac.ir 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
  • Slide 53
  • Domain Name System Whats the IP address for www.ccieee.com? It is 128.2.11.43 DNS server address manually configured into OS Local DNS ServerComputer 1
  • Slide 54
  • 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
  • Slide 55
  • 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
  • Slide 56
  • 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
  • Slide 57
  • Third: Transport Layer First end-to-end layer End-to-end state May provide reliability, flow and congestion control
  • Slide 58
  • 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.
  • Slide 59
  • 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
  • Slide 60
  • 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
  • Slide 61
  • Whats Different From Link Layers? Logical link vs. physical link Must establish connection Variable RTT (Round-Trip Time) May vary within a connection Reordering packets How long can packets live max segment lifetime Cant expect endpoints to exactly match link Buffer space availability Packets in transmission, delay X bandwidth Transmission rate Dont directly know transmission rate
  • Slide 62
  • TCP Header Source portDestination port Sequence number Acknowledgement Advertised windowHdrLen Flags 0 ChecksumUrgent pointer Options (variable) Data Flags: SYN FIN RESET PUSH URG ACK
  • Slide 63
  • 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
  • Slide 64
  • 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 (recovery time objective) estimation Fast retransmit Adapting to resource availability Congestion avoidance
  • Slide 65
  • TCP Congestion Control Basics Keep a congestion window, cwnd Denotes how much network is able to absorb Senders maximum window: Min (advertised window, cwnd) Senders 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
  • Slide 66
  • Self-clocking PrPr PbPb ArAr AbAb Receiver Sender AsAs
  • Slide 67
  • 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
  • Slide 68
  • 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
  • Slide 69
  • Congestion Window Time Congestion Window Slow start with each time out
  • Slide 70
  • 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
  • Slide 71
  • 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
  • Slide 72
  • Fast Retransmit Dont 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
  • Slide 73
  • 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
  • Slide 74
  • Fast Recovery
  • Slide 75
  • Time Sequence No Sent for each dupack after W/2 dupacks arrive
  • Slide 76
  • Fourth : Application Demands Reliability Corruption Lost packets Flow and congestion control Fragmentation In-order delivery Etc
  • Slide 77
  • 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
  • Slide 78
  • What if the Data gets Lost? Internet GET index.html Problem: Lost Data Internet GET index.html Solution: Timeout and Retransmit GET index.html
  • Slide 79
  • What if Network is Overloaded? Short bursts: buffer What if buffer overflows? Packets dropped and retransmitted Sender adjusts rate until load = resources Called Congestion control Problem: Network Overload Solution: Buffering and Congestion Control
  • Slide 80
  • What if the Data Doesnt Fit? Problem: Packet size Solution: Fragment data across packets On Ethernet, max IP packet is 1.5kbytes Typical web page is 10kbytes GETindex.html GET index.html
  • Slide 81
  • What if the Data is Out of Order? Solution: Add Sequence Numbers Problem: Out of Order GETx.thindeml GET x.thindeml GET index.html ml4inde2x.th3GET1
  • Slide 82
  • 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
  • Slide 83
  • 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
  • Slide 84
  • 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?
  • Slide 85
  • Queues and Queuing Delay Cross traffic causes congestion and variable queuing delay.
  • Slide 86
  • ?