5 data link-lan.key

2,518 views

Published on

Computer Networking : Principles, Protocols and Practice part 5

Published in: Education
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,518
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
99
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • These slides are licensed under the creative commons attribution share-alike license 3.0. You can obtain detailed information about this
    license at http://creativecommons.org/licenses/by-sa/3.0/



    The slides are part of an effort to develop an open-source networking textbook. See http://inl.info.ucl.ac.be/CNP3 for the current version of the textbook and more information on how to contribute.



































  • Packet 1 :
    1 2 3 'DLE' 4


    Frame 1 :
    'DLE' 'STX'
    1 2 3
    'DLE'
    'DLE' 4
    'DLE' 'ETX'


    Packet 2 :
    'DLE' 'STX' 'DLE' 'ETX'



    Frame 2 :
    'DLE' 'STX'

    'DLE'
    'DLE' 'STX'
    'DLE'
    'DLE'
    'DLE' 'ETX'


    Packet 3 :
    'STX' 'DLE'


    Frame 3 :
    'DLE' 'STX'
    'STX'
    'DLE'
    'DLE'
    'DLE' 'ETX'





    'DLE' 'STX'
    1 2 3
    'DLE'
    'DLE' 4
    'DLE' 'ETX' 'DLE' 'STX' 'DLE'
    'DLE' 'STX'
    'DLE'
    'DLE'
    'DLE' 'ETX' 'DLE' 'STX'
    'STX'
    'DLE'
    'DLE'
    'DLE' 'ETX'













  • W. Simpson and Editor. The point-to-point protocol (PPP). Request for Comments 1661, Internet Engineering Task Force, July 1994.







    W. Simpson and Editor. PPP in HDLC-like framing. Request for Comments 1662, Internet Engineering Task Force, July 1994.







    There is an older protocol called SLIP

















  • ALOHA is discussed in
    N. Abramson, The ALOHA system – another alternative for Computer Communications, Proc. Fall Joint Computer Conference, AFIPCS Conference 1970
    N. Abramson, Development of the Alohanet, IEEE Transactions on Information Theory, Vol IT-31, No. 3, pp. 119-123
















































  • CSMA/CD is described in
    R. Metcalfe and D. Boggs. Ethernet: Distributed packet-switching for local computer networks. Communications of the ACM, 19(7):395--404, 1976. available from
    http://www.acm.org/pubs/citations/journals/cacm/1976-19-7/p395-metcalfe/
  • The interframe delay is used to ensure that the electronics of the receiver can be synchronised to the transmitted signal. A typical interframe delay is 9.6µsec


































  • CSMA/CA is used by 802.11, see
    LAN/MAN Standards Committee of the IEEE Computer Society. IEEE Standard for Information Technology - Telecommunications and information exchange between systems - local and metropolitan area networks - specific requirements - Part 11 : Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) Specifications. IEEE, 1999. available from



    http://standards.ieee.org/getieee802/802.11.html

    .







    A short but detailed description of CSMA/CA may be found in


    M. Schwartz, Mobile Wireless Communications, Cambridge University Press, 2005









































  • The value T is defined in the standard, but a detailed discussion of this value is outside the scope of this presentation.






































  • LAN/MAN Standards Committee of the IEEE Computer Society. IEEE Standard for Information Technology - Telecommunications and information exchange between systems - local and metropolitan area networks - specific requirements - Part 3 : Carrier Sense multiple access with collision detection (CSMA/CD) access method and physical layer specification. IEEE, 2000. available from

    http://standards.ieee.org/getieee802/802.3.html




  • Ethernet addresses are usually printed as hexadecimal numbers, e.g.



    alpha.infonet.fundp.ac.be (at 00:80:C8:FB:21:2B [ether] on eth0
    cr1.info.fundp.ac.be at 00:50:BD:D0:E0:00 [ether] on eth0
    backus.info.fundp.ac.be at 08:00:20:A6:62:8A [ether] on eth0
    inspiron.infonet.fundp.ac.be at 00:50:04:8C:83:70 [ether] on eth0
    corneille.info.fundp.ac.be at 00:20:AF:52:44:4B [ether] on eth0




    See

    http://standards.ieee.org/regauth/oui/oui.txt

    for the list of allocations










  • This is the most widely used format, it is notably used to carry IP packets.
  • This is the most widely used format, it is notably used to carry IP packets.
  • This is the most widely used format, it is notably used to carry IP packets.























  • D. C. Plummer. Ethernet address resolution protocol: Or converting network protocol addresses to 48.bits ethernet address for transmission on ethernet hardware. Request for Comments 826, Internet Engineering Task Force, November 1982.



  • D. C. Plummer. Ethernet address resolution protocol: Or converting network protocol addresses to 48.bits ethernet address for transmission on ethernet hardware. Request for Comments 826, Internet Engineering Task Force, November 1982.










  • The transmission of IPv6 packets over Ethernet is defined in :
    M. Crawford, Transmission of IPv6 Packets over Ethernet Networks, RFC2464, December 1998




    Note that in contrast with ARP used by IPv4, ICMPv6 neighbour solicitation messages are sent to a multicast ethernet address and not to the broadcast ethernet address. This implies that only the IPv6 enabled hosts on the LAN will receive the ICMPv6 message.
  • The ICMPv6 neighbour discovery messages are sent with HopLimit=255



    The role of the R, S and O flags is described as follows in RFC4861



    R Router flag. When set, the R-bit indicates that
    the sender is a router. The R-bit is used by
    Neighbor Unreachability Detection to detect a
    router that changes to a host.



    S Solicited flag. When set, the S-bit indicates that
    the advertisement was sent in response to a
    Neighbor Solicitation from the Destination address.
    The S-bit is used as a reachability confirmation
    for Neighbor Unreachability Detection. It MUST NOT
    be set in multicast advertisements or in
    unsolicited unicast advertisements.



    O Override flag. When set, the O-bit indicates that
    the advertisement should override an existing cache
    entry and update the cached link-layer address.
    When it is not set the advertisement will not
    update a cached link-layer address though it will
    update an existing Neighbor Cache entry for which
    no link-layer address is known. It SHOULD NOT be
    set in solicited advertisements for anycast
    addresses and in solicited proxy advertisements.
    It SHOULD be set in other solicited advertisements
    and in unsolicited advertisements.
  • The ICMPv6 neighbour discovery messages are sent with HopLimit=255



    The role of the R, S and O flags is described as follows in RFC4861



    R Router flag. When set, the R-bit indicates that
    the sender is a router. The R-bit is used by
    Neighbor Unreachability Detection to detect a
    router that changes to a host.



    S Solicited flag. When set, the S-bit indicates that
    the advertisement was sent in response to a
    Neighbor Solicitation from the Destination address.
    The S-bit is used as a reachability confirmation
    for Neighbor Unreachability Detection. It MUST NOT
    be set in multicast advertisements or in
    unsolicited unicast advertisements.



    O Override flag. When set, the O-bit indicates that
    the advertisement should override an existing cache
    entry and update the cached link-layer address.
    When it is not set the advertisement will not
    update a cached link-layer address though it will
    update an existing Neighbor Cache entry for which
    no link-layer address is known. It SHOULD NOT be
    set in solicited advertisements for anycast
    addresses and in solicited proxy advertisements.
    It SHOULD be set in other solicited advertisements
    and in unsolicited advertisements.
  • The ICMPv6 neighbour discovery messages are sent with HopLimit=255



    The role of the R, S and O flags is described as follows in RFC4861



    R Router flag. When set, the R-bit indicates that
    the sender is a router. The R-bit is used by
    Neighbor Unreachability Detection to detect a
    router that changes to a host.



    S Solicited flag. When set, the S-bit indicates that
    the advertisement was sent in response to a
    Neighbor Solicitation from the Destination address.
    The S-bit is used as a reachability confirmation
    for Neighbor Unreachability Detection. It MUST NOT
    be set in multicast advertisements or in
    unsolicited unicast advertisements.



    O Override flag. When set, the O-bit indicates that
    the advertisement should override an existing cache
    entry and update the cached link-layer address.
    When it is not set the advertisement will not
    update a cached link-layer address though it will
    update an existing Neighbor Cache entry for which
    no link-layer address is known. It SHOULD NOT be
    set in solicited advertisements for anycast
    addresses and in solicited proxy advertisements.
    It SHOULD be set in other solicited advertisements
    and in unsolicited advertisements.

  • M
    64
    (800:200C:417A) is a function that converts a 48 bits MAC address into a 64 bits Interface Identifier. This function is defined in :


    R. Hinden, S. Deering, IP Version 6 Addressing Architecture,
    RFC4291,
    February 2006










    The IPv6 autoconfiguration is defined in :



    S. Thomson, T. Narten, T. Jinmei, IPv6 Stateless Address Autoconfiguration, RFC4862, Sept. 2007








  • M
    64
    (800:200C:417A) is a function that converts a 48 bits MAC address into a 64 bits Interface Identifier. This function is defined in :


    R. Hinden, S. Deering, IP Version 6 Addressing Architecture,
    RFC4291,
    February 2006










    The IPv6 autoconfiguration is defined in :



    S. Thomson, T. Narten, T. Jinmei, IPv6 Stateless Address Autoconfiguration, RFC4862, Sept. 2007







  • When the M bit is set to true, this indicates that IPv6 addresses should be obtained from DHCPv6



    When the O bit is set to true, this indicates that the hosts can obtain additional information (e.g. address of DNS resolver) from DHCPv6



    The router advertisements messages can also be sent in unicast in response to solicitations from hosts. A host can obtain a router advertisement by sending a router solicitation which is an ICMPv6 message containing only the router solicitation message (type 133).
  • When the M bit is set to true, this indicates that IPv6 addresses should be obtained from DHCPv6



    When the O bit is set to true, this indicates that the hosts can obtain additional information (e.g. address of DNS resolver) from DHCPv6



    The router advertisements messages can also be sent in unicast in response to solicitations from hosts. A host can obtain a router advertisement by sending a router solicitation which is an ICMPv6 message containing only the router solicitation message (type 133).
  • When the M bit is set to true, this indicates that IPv6 addresses should be obtained from DHCPv6



    When the O bit is set to true, this indicates that the hosts can obtain additional information (e.g. address of DNS resolver) from DHCPv6



    The router advertisements messages can also be sent in unicast in response to solicitations from hosts. A host can obtain a router advertisement by sending a router solicitation which is an ICMPv6 message containing only the router solicitation message (type 133).
  • When the M bit is set to true, this indicates that IPv6 addresses should be obtained from DHCPv6



    When the O bit is set to true, this indicates that the hosts can obtain additional information (e.g. address of DNS resolver) from DHCPv6



    The router advertisements messages can also be sent in unicast in response to solicitations from hosts. A host can obtain a router advertisement by sending a router solicitation which is an ICMPv6 message containing only the router solicitation message (type 133).
  • When the M bit is set to true, this indicates that IPv6 addresses should be obtained from DHCPv6



    When the O bit is set to true, this indicates that the hosts can obtain additional information (e.g. address of DNS resolver) from DHCPv6



    The router advertisements messages can also be sent in unicast in response to solicitations from hosts. A host can obtain a router advertisement by sending a router solicitation which is an ICMPv6 message containing only the router solicitation message (type 133).
  • The two L and A bits are defined as follows :






    L 1-bit on-link flag. When set, indicates that this
    prefix can be used for on-link determination. When
    not set the advertisement makes no statement about
    on-link or off-link properties of the prefix. In
    other words, if the L flag is not set a host MUST
    NOT conclude that an address derived from the
    prefix is off-link. That is, it MUST NOT update a
    previous indication that the address is on-link.



    A 1-bit autonomous address-configuration flag. When
    set indicates that this prefix can be used for
    stateless address configuration.



    Other options have been defined for the router advertisements. For example, the RDNSS option defined in
    J. Jeong, S. Park, L. Beloeil, S. Madanapalli, IPv6 Router Advertisement Option for DNS Configuration, RFC 5006, Sept. 2007



    allows a router to advertise the IPv6 address of the DNS resolver to be used by hosts on the LAN.


  • The two L and A bits are defined as follows :






    L 1-bit on-link flag. When set, indicates that this
    prefix can be used for on-link determination. When
    not set the advertisement makes no statement about
    on-link or off-link properties of the prefix. In
    other words, if the L flag is not set a host MUST
    NOT conclude that an address derived from the
    prefix is off-link. That is, it MUST NOT update a
    previous indication that the address is on-link.



    A 1-bit autonomous address-configuration flag. When
    set indicates that this prefix can be used for
    stateless address configuration.



    Other options have been defined for the router advertisements. For example, the RDNSS option defined in
    J. Jeong, S. Park, L. Beloeil, S. Madanapalli, IPv6 Router Advertisement Option for DNS Configuration, RFC 5006, Sept. 2007



    allows a router to advertise the IPv6 address of the DNS resolver to be used by hosts on the LAN.


  • The two L and A bits are defined as follows :






    L 1-bit on-link flag. When set, indicates that this
    prefix can be used for on-link determination. When
    not set the advertisement makes no statement about
    on-link or off-link properties of the prefix. In
    other words, if the L flag is not set a host MUST
    NOT conclude that an address derived from the
    prefix is off-link. That is, it MUST NOT update a
    previous indication that the address is on-link.



    A 1-bit autonomous address-configuration flag. When
    set indicates that this prefix can be used for
    stateless address configuration.



    Other options have been defined for the router advertisements. For example, the RDNSS option defined in
    J. Jeong, S. Park, L. Beloeil, S. Madanapalli, IPv6 Router Advertisement Option for DNS Configuration, RFC 5006, Sept. 2007



    allows a router to advertise the IPv6 address of the DNS resolver to be used by hosts on the LAN.


  • This utilisation of ICMPv6 Neighbour solicitation is called Duplicate Address Detection. It is used everytime a host obtains a new IPv6 address and is required to ensure that a hostis not using the same IPv6 address as another host on the same LAN.


  • IPv6 is supposed to easily support renumbering and IPv6 router advertisements are one of the ways to perform this renumbering by allowing hosts to update their IPv6 addresses upon
    reception of new router advertisement messages. However, in practice renumbering an IPv6 network is not easily because IPv6 addresses are manually encoded in too many
    configuration files, see e.g. :



    F. Baker, E. Lear, R. Droms, Procedures for Renumbering an IPv6 Network without a Flag Day, RFC4192, 2005




  • This extension to support privacy-aware IPv6 addresses is defined in



    T. Narten, R. Draves, S. Krishnan, Privacy Extensions for Stateless Address Autoconfiguration in IPv6, RFC4941, Sept. 2007


















  • A good reference on Ethernet switches is



    R. Seifert, J. Edwards, The All-New Switch Book, Wiley, 2008
  • A good reference on Ethernet switches is



    R. Seifert, J. Edwards, The All-New Switch Book, Wiley, 2008












































































  • R. Seifert. Gigabit Ethernet : Technology and Applications for High-Speed LANs. Addison Wesley, 1998. ISBN 0201185539.



    http://www.ethermanage.com/ethernet/ethernet.html




  • The 10 Gbps zoo is much larger than this, see e.g. http://en.wikipedia.org/wiki/10_gigabit_Ethernet












  • See



    [IEEE802Q] "IEEE Standards for Local and Metropolitan Area

    Networks: Virtual Bridged Local Area Networks", Draft Standard, P802.1Q/D9, February 20, 1998.



















  • Source http://en.wikipedia.org/wiki/IEEE_802.11n












  • Example



    802.11b channel frequencies
    Channel Lower frequency Central frequency Upper frequency
    12.4012.4122.423
    22.4042.4172.428
    32.4112.4222.433
    42.4162.4272.438
    52.4212.4322.443
    62.4262.4372.448
    72.4312.4422.453
    82.4362.4472.458
    92.4412.4522.463
    102.4462.4572.468
    112.4512.4622.473


































  • Token Ring is defined in :

    LAN/MAN Standards Committee of the IEEE Computer Society. IEEE Standard for Information technology--Telecommunications and information exchange between systems--Local and metropolitan area networks--Specific requirements--Part 5: Token Ring Access Method and Physical Layer Specification. IEEE, 1998. available from

    http://standards.ieee.org/getieee802/802.5.html




















  • FDDI is defined in
    ANSI. Information systems - fiber distributed data interface (FDDI) - token ring media access control (mac). ANSI X3.139-1987 (R1997), 1997
  • FDDI is defined in
    ANSI. Information systems - fiber distributed data interface (FDDI) - token ring media access control (mac). ANSI X3.139-1987 (R1997), 1997


















  • 5 data link-lan.key

    1. 1. Computer Networking : Principles, Protocols and Practice Part 5 Datalink Layer and Local Area Network Olivier Bonaventure http://inl.info.ucl.ac.be/ CNP3/2008.5. © O. Bonaventure 2008
    2. 2. Datalink layer  Point-to datalink layer  How to transmit and receive frames  Local area networks  Optimistic Medium access control  ALOHA, CSMA, CSMA/CD, CSMA/CA  Ethernet networks  WiFi networks  Deterministic Medium access control  Token Ring, FDDI CNP3/2008.5. © O. Bonaventure, 2008
    3. 3. Usage of the physical layer  Service provided by physical layer  Bit transmission between nodes attached to the same physical transmission channel  cable, radio, optical fiber, ...  Better service for computers  Transmission/reception of short messages  Service provided by the datalink layer 2 Datalink Datalink 1 Physical Physical CNP3/2008.5. © O. Bonaventure, 2008
    4. 4. Datalink layer  Goals  Provide a reliable transfert of packets although  Physical layer sends/receives bits and not packets  Physical layer service is imperfect  transmission errors  Losses of bits  Creation of bits Packet Datalink Datalink CNP3/2008.5. © O. Bonaventure, 2008
    5. 5. Datalink layer  Goals  Provide a reliable transfert of packets although  Physical layer sends/receives bits and not packets  Physical layer service is imperfect  transmission errors  Losses of bits  Creation of bits Packet Packet Datalink Datalink CNP3/2008.5. © O. Bonaventure, 2008
    6. 6. Frame delineation  Frame  Unit of information transfer between two entities of the datalink layer  sequence of N bits  Datalink layer usually supports variable-length frames Packet Packet Datalink Frames Datalink Physical Bits Physical  How can the receiver extract the frames from the received bit stream ? CNP3/2008.5. © O. Bonaventure, 2008
    7. 7. Frame delineation  Naïve solutions  Use frame size to delineate frames  Insert frame size in frame header  Issue  What happens when errors affect frame payload and frame header ?  Use special character/bitstring to mark beginning/ end of frame  Example  all frames start with #  Issue  What happens when the special character/bitstring appears inside the frame payload ? CNP3/2008.5. © O. Bonaventure, 2008
    8. 8. Character stuffing  Character stuffing  Suitable for frames containing an integer number of bytes  'DLE' 'STX' to indicate beginning of frame  'DLE' 'ETX' to indicate end of frame  When transmitting frame, sender replaces 'DLE' by 'DLE' 'DLE' if 'DLE' appears inside the frame  Receiver removes 'DLE' if followed by 'DLE'  Example  Packet : 1 2 3 'DLE' 4  Frame 'DLE' 'STX' 1 2 3 'DLE' 'DLE' 4 'DLE' 'ETX' CNP3/2008.5. © O. Bonaventure, 2008
    9. 9. Bit stuffing  Alternative to character stuffing  Suitable for frames composed of n bits  01111110 used as marker at beginning and end of frame  Sender behaviour  If five bits set to ʻ1ʼ must be sent, sender adds a bit set to ʻ0ʼ immediately after the fifth bit set to ʻ1ʼ  Receiver behaviour  Counts the number of successive bits set to 1  6 successive bits set to 1 followed by 0 : marker  5 successive bits set to 1 followed by 0 : remove bit set to 0  Example  Packet : 0110111111111111111110010  Frame 01111110011011111011111011111011001001111110 CNP3/2008.5. © O. Bonaventure, 2008
    10. 10. Frame delineation  Co-operation with physical layer  Some physical layers are able to transmit special physical codes that represent neither 0 nor 1  Example : Manchester coding 1 0 1 0 0 1 1 0 InvHInvB  invH (or N times invH) could be used to mark the beginning of a frame and invB (or N times invB) to mark the end of a frame CNP3/2008.5. © O. Bonaventure, 2008
    11. 11. Frame delineation in practice  Most datalink protocols use  Character stuffing or bit stuffing  Character stuffing is preferred by software implementations  A length field in the frame header  A checksum or CRC in the header or trailer to detect transmission errors  A receiver frame is considered valid if  the correct delimiter appears at the beginning  the length is correct  the CRC/checksum is valid  the correct delimiter appears at the beginning CNP3/2008.5. © O. Bonaventure, 2008
    12. 12. PPP : Point-to-Point Protocol  Goal  Allow the transmission of network layer (IP but also other protocols) packets over serial lines  modems, leased lines, ISDN, ...  Architecture  PPP is composed of three different protocols 1. PPP  transmission of data frames (e.g. IP packets) 2. LCP : Link Control Protocol • Negotiation of some options and authentication (username, password) and end of connection 3. NCP : Network Control Protocol • Negotiation of options related to the network layer protocol used above PPP (ex: IP address, IP address of DNS resolver, ...) CNP3/2008.5. © O. Bonaventure, 2008
    13. 13. PPP (2)  PPP frame format Flag Address Control Checksum Flag 01111110 11111111 00000011 Protocol Packet 16bits/32bits 01111110 Identification of the network layer packet transported in the PPP frame  Mechanisms used by PPP  character stuffing for asynchronous lines  bit stuffing for synchronous lines  CRC for error detection  16 bits default but 32 bits CRC can be negotiated  No error correction by default  a reliable protocol can be negotiated  Data compression option  content of PPP frames can be compressed. To be negotiated at beginning of PPP connection CNP3/2008.5. © O. Bonaventure, 2008
    14. 14. DataLink layer  Point-to datalink layer  How to transmit and receive frames  Local area networks  Optimistic Medium access control  ALOHA, CSMA, CSMA/CD, CSMA/CA  Ethernet networks  WiFi networks  Deterministic Medium access control  Token Ring, FDDI CNP3/2008.5. © O. Bonaventure, 2008
    15. 15. Local area networks  How to efficiently connect N hosts together ?  Ideally we would like to have a single cable on each host while being able to reach all the others  Network topologies  Star-shaped network  Ring-shaped network  Bus-shaped network CNP3/2008.5. © O. Bonaventure, 2008
    16. 16. Local area networks  Problems to be solved  How to identify the hosts attached to the LAN ?  The LAN is a shared resource  How to regulate access to this shared resource to provide :  fairness  All hosts should be able to use a fair fraction of the shared resource  performance  The shared resource should be used efficiently CNP3/2008.5. © O. Bonaventure, 2008
    17. 17. Static allocation  Time Division Multiplexing A D B C T A B C DA B C D A B C D A B C D A B C D A B C D A B C D DA CNP3/2008.5. © O. Bonaventure, 2008
    18. 18. Static allocation  Time Division Multiplexing A D B C T A B C DA B C D A B C D A B C D A B C D A B C D A B C D DA  No suitable for a computer network  Leads to low link utilisation and high delays  Computers generate bursty trafic  A more adaptive access control mechanism is required CNP3/2008.5. © O. Bonaventure, 2008
    19. 19. Medium access control  Hypotheses  N stations need to share the same transmission channel  A single transmission channel is available  Definition  Collision  If two stations transmit their frame at the same time, their electrical signal appears on the channel and causes a collision  Options  Frame transmission  A station can transmit at any time  A station can only transmit at specific instants  Listening while transmitting  A station can listen while transmitting  A station cannot listen while transmitting CNP3/2008.5. © O. Bonaventure, 2008
    20. 20. Medium access control  How to regulate access to the shared medium ?  Statistical or optimistic solutions  hosts can transmit frames at almost any time  if the low is low, the frames will arrive correctly at destination  if the low is high, frames may collide  distributed algorithm allows to recover from the collisions  Deterministic or pessimistic solutions  Collisions are expensive and need to be avoided Distributed algorithm distributes authorisations to transmit to ensure that a single host is allowed to transmit at any time  avoids collisions when load is high, but may delay transmission when load is low CNP3/2008.5. © O. Bonaventure, 2008
    21. 21. DataLink layer  Point-to datalink layer  How to transmit and receive frames  Local area networks  Optimistic Medium access control  ALOHA, CSMA, CSMA/CD, CSMA/CA  Ethernet networks  WiFi networks  Deterministic Medium access control  Token Ring, FDDI CNP3/2008.5. © O. Bonaventure, 2008
    22. 22. ALOHA  Problem  terminals need to exchange data with computer but phone lines are costly  Solution  Wireless network  upstream frequency shared by all terminals  terminals do not hear each other  downlink frequency reserved for computer CNP3/2008.5. © O. Bonaventure, 2008
    23. 23. ALOHA (3)  How to organise frame transmission ?  If a host is alone, no problem  If two hosts transmit at the same time, a collision will occur and it will be impossible to decode their transmission A B CNP3/2008.5. © O. Bonaventure, 2008
    24. 24. ALOHA (3)  How to organise frame transmission ?  If a host is alone, no problem  If two hosts transmit at the same time, a collision will occur and it will be impossible to decode their transmission A B CNP3/2008.5. © O. Bonaventure, 2008
    25. 25. ALOHA (3)  How to organise frame transmission ?  If a host is alone, no problem  If two hosts transmit at the same time, a collision will occur and it will be impossible to decode their transmission A B CNP3/2008.5. © O. Bonaventure, 2008
    26. 26. ALOHA (3)  How to organise frame transmission ?  If a host is alone, no problem  If two hosts transmit at the same time, a collision will occur and it will be impossible to decode their transmission A B collision CNP3/2008.5. © O. Bonaventure, 2008
    27. 27. ALOHA (3)  How to organise frame transmission ?  If a host is alone, no problem  If two hosts transmit at the same time, a collision will occur and it will be impossible to decode their transmission A B collision CNP3/2008.5. © O. Bonaventure, 2008
    28. 28. ALOHA (3)  Medium access algorithm  First solution N=1; while ( N<= max) do send frame; wait for ack on return channel or timeout: if ack on return channel exit while; else /* timeout */ /* retransmission is needed */ N=N+1; end do /* too many attempts */ CNP3/2008.5. © O. Bonaventure, 2008
    29. 29. ALOHA (4)  Drawback  When two stations enter in collision, they may continue to collide after T0 T3 T3+timeout A B Collision T1 T2 T2+timeout  How to avoid this synchronisation among stations ? CNP3/2008.5. © O. Bonaventure, 2008
    30. 30. ALOHA (5)  Improved algorithm  N=1; while ( N<= max) do send frame; wait for ack on return channel or timeout: if ack on return channel exit while; else /* timeout */ /* retransmission is needed */ wait for random time; N=N+1; end do /* too many attempts */ CNP3/2008.5. © O. Bonaventure, 2008
    31. 31. Slotted ALOHA  How to improve ALOHA  Idea  Divide time in slots and force stations to only transmit frames at the beginning of slots  requires a common clock heard by all stations  decrease risk of collisions since a slot is either  empty (no frame)  full (a single frame was transmitted)  in collision (more than one frame was transmitted) CNP3/2008.5. © O. Bonaventure, 2008
    32. 32. Slotted ALOHA  How to improve ALOHA  Idea  Divide time in slots and force stations to only transmit frames at the beginning of slots  requires a common clock heard by all stations  decrease risk of collisions since a slot is either  empty (no frame)  full (a single frame was transmitted)  in collision (more than one frame was transmitted) A B collision CNP3/2008.5. © O. Bonaventure, 2008
    33. 33. Carrier Sense Multiple Access  How to improve slotted Aloha ?  Idea  Stations should be polite  Listens to the transmission channel before transmitting  Wait until the channel becomes free to transmit  Limitations  Politeness is only possible if all stations can listen to the transmission of all stations  true when all stations are attached to the same cable, but not in wireless networks CNP3/2008.5. © O. Bonaventure, 2008
    34. 34. CSMA  CSMA  Carrier Sense Multiple Access N=1; while ( N<= max) do wait until channel becomes free; send frame immediately; wait for ack or timeout: if ack received exit while; else /* timeout */ /* retransmission is needed */ N=N+1; end do /* too many attempts */ CNP3/2008.5. © O. Bonaventure, 2008
    35. 35. non-persistent CSMA  Idea  Transmitting a frame immediately after the end of the previous one is a very aggressive behaviour  If the channel is free, transmit  Otherwise wait some random time before listening again N=1; while ( N<= max) do listen channel; if channel is empty send frame; wait for ack or timeout if ack received exit while; else /* retransmission is needed */ N=N+1: else wait for random time; end do CNP3/2008.5. © O. Bonaventure, 2008
    36. 36. p-persistent CSMA  Tradeoff between CSMA and non-persistent CSMA N=1; while ( N<= max) do listen channel; if channel is empty with probability p send frame; wait for ack or timeout if ack received exit while; else /* retransmission needed */ N=N+1; else wait for random time; end do CNP3/2008.5. © O. Bonaventure, 2008
    37. 37. Improvements to CSMA  Problems with CSMA  If one bit of a frame is affected by a collision, the entire frame is lost  Solution  Stop the transmission of a frame as soon as a collision has been detected  How to detect collisions ?  Station listens to channel while transmitting  If there is no collision, it will hear the signal it transmits  If there is a collision, is will hear an incorrect signal  CSMA/CD  Carrier Sense Multiple Access with Collision CNP3/2008.5. Detection © O. Bonaventure, 2008
    38. 38. CSMA/CD  Medium access control N=1; while ( N<= max) do wait until channel becomes free; send frame and listen; wait until (end of frame) or (collision) if collision detected stop transmitting; /* after a special jam signal */ else /* no collision detected */ wait for interframe delay; exit while; N=N+1; end do /* too many attempts */ CNP3/2008.5. © O. Bonaventure, 2008
    39. 39. CSMA/CD : Example A B CNP3/2008.5. © O. Bonaventure, 2008
    40. 40. CSMA/CD : Example A B 1 Start of frame CNP3/2008.5. © O. Bonaventure, 2008
    41. 41. CSMA/CD : Example A B 1 Start of frame 2 Frame is propagated on LAN (5 microsecond per kilometer) CNP3/2008.5. © O. Bonaventure, 2008
    42. 42. CSMA/CD : Example A B 1 Start of frame 2 Frame is propagated on LAN (5 microsecond per kilometer) 3 Frame stops at left side and first bit reaches B CNP3/2008.5. © O. Bonaventure, 2008
    43. 43. CSMA/CD : Example A B 1 Start of frame 2 Frame is propagated on LAN (5 microsecond per kilometer) 3 Frame stops at left side and first bit reaches B 4 Frame leaves the LAN CNP3/2008.5. © O. Bonaventure, 2008
    44. 44. CSMA/CD : Collisions A B CNP3/2008.5. © O. Bonaventure, 2008
    45. 45. CSMA/CD : Collisions A B 1 Frame starts at A and B almost at the same time CNP3/2008.5. © O. Bonaventure, 2008
    46. 46. CSMA/CD : Collisions A B 1 Frame starts at A and B almost at the same time Collision : at this point on the shared medium, it is impossible to decode the signal 2 CNP3/2008.5. © O. Bonaventure, 2008
    47. 47. CSMA/CD : Collisions A B 1 Frame starts at A and B almost at the same time Collision : at this point on the shared medium, it is impossible to decode the signal 2 A detects the collision and stops transmitting its frame 3 CNP3/2008.5. © O. Bonaventure, 2008
    48. 48. CSMA/CD : Collisions (2)  Advantages  Improves channel utilisation as stations do not transmit corrupted frames  a station can detect whether its frame was sent without collision  implicit acknowledgement if destination is up  when a collision is detected, automatic retransmission  Is it possible for a station to detect all collisions on all its frames ? CNP3/2008.5. © O. Bonaventure, 2008
    49. 49. CSMA/CD : Collisions (3) A B CNP3/2008.5. © O. Bonaventure, 2008
    50. 50. CSMA/CD : Collisions (3) A B 1 A and B send a small frame almost at the same time CNP3/2008.5. © O. Bonaventure, 2008
    51. 51. CSMA/CD : Collisions (3) A B 1 A and B send a small frame almost at the same time 2 The two frame collide in the middle of the medium CNP3/2008.5. © O. Bonaventure, 2008
    52. 52. CSMA/CD : Collisions (3) A B 1 A and B send a small frame almost at the same time 2 The two frame collide in the middle of the medium 3 A did not notice any collision B did not notice any collision They both consider that their frames were received correctly CNP3/2008.5. © O. Bonaventure, 2008
    53. 53. CSMA/CD : Collisions (4)  How to ensure that all collisions are detected ?  Worst case scenario A B CNP3/2008.5. © O. Bonaventure, 2008
    54. 54. CSMA/CD : Collisions (4)  How to ensure that all collisions are detected ?  Worst case scenario A B 1 Start of the frame sent by A CNP3/2008.5. © O. Bonaventure, 2008
    55. 55. CSMA/CD : Collisions (4)  How to ensure that all collisions are detected ?  Worst case scenario A B 1 Start of the frame sent by A 2 After τ seconds, Aʼs frame reaches B A time τ−ε, B starts to transmit its own frame B notices the collision immediately and stops transmitting CNP3/2008.5. © O. Bonaventure, 2008
    56. 56. CSMA/CD : Collisions (4)  How to ensure that all collisions are detected ?  Worst case scenario A B 1 Start of the frame sent by A 2 After τ seconds, Aʼs frame reaches B A time τ−ε, B starts to transmit its own frame B notices the collision immediately and stops transmitting 3 A detects collision at time τ+τ−ε CNP3/2008.5. © O. Bonaventure, 2008
    57. 57. CSMA/CD : Collisions (5)  How can a station ensure that it will be able to detect all the collisions affecting its frames ?  Each frame must be transmitted for at least a duration equal to the two way delay (2∗τ)  As the throughput on a bus is fixed, if the two way delay is fixed, then all frames must be larger than a minimum frame size  Improvement  To ensure that all stations detect collisions, a station that notices a collision should send a jamming signal CNP3/2008.5. © O. Bonaventure, 2008
    58. 58. Exponential backoff  How to deal with collisions ?  If the stations that collide retransmit together, a new collision will happen  Solution  Wait some random time after the collision  After collision, time is divided in slots  a slot = time required to send a minimum sized frame  After first collision, wait 0 or 1 slot before retransmitting  After first collision, wait 0, 1,2 or 3 slots before retransmitting  After first collision, wait 0..2i-1 slots before retransmitting CNP3/2008.5. © O. Bonaventure, 2008
    59. 59. CSMA/CD with exponential backoff  Medium access control N=1; while ( N<= max) do wait until channel becomes free; send frame and listen; wait until (end of frame) or (collision) if collision detected stop transmitting; /* after a special jam signal */ k = min (10, N); r = random(0, 2k - 1) * slotTime; wait for r time slots; else /* no collision detected */ wait for interframe delay; exit while; N=N+1; end do /* too many attempts */ CNP3/2008.5. © O. Bonaventure, 2008
    60. 60. CSMA with Collision Avoidance  Goal  Design a medium access control method suitable for wireless networks  on a wireless network, a sender cannot usually listen to its transmission (and thus CSMA/CD cannot be used)  Improvements to CSMA  Initial delay before transmitting if channel is empty  Extended Inter Frame Space (EIFS)  Minimum delay between two successive frames  Distributed Coordination Function Inter Frame Space (DIFS)  Delay between frame reception and ack transmission  Short Inter Frame Spacing (SIFS, SIFS< DIFS < EIFS) CNP3/2008.5. © O. Bonaventure, 2008
    61. 61. CSMA/CA (1)  Sender N=1; while ( N<= max) do if (previous frame corrupted) { wait until channel free during t>=EIFS; } else { wait until endofframe; wait until channel free during t>=DIFS; } send data frame ; wait for ack or timeout: if ack received exit while; else /* timeout retransmission is needed */ N=N+1; end do /* too many attempts */ CNP3/2008.5. © O. Bonaventure, 2008
    62. 62. CSMA/CA (2)  Receiver While (true) { Wait for data frame; if not(duplicate) { deliver (frame) } wait during SIFS; send ack (frame) ; } CNP3/2008.5. © O. Bonaventure, 2008
    63. 63. CSMA/CA : Example B C A CNP3/2008.5. © O. Bonaventure, 2008
    64. 64. CSMA/CA : Example B C A DIFS CNP3/2008.5. © O. Bonaventure, 2008
    65. 65. CSMA/CA : Example B C A DIFS Data frame CNP3/2008.5. © O. Bonaventure, 2008
    66. 66. CSMA/CA : Example B C A DIFS Data frame SIFS CNP3/2008.5. © O. Bonaventure, 2008
    67. 67. CSMA/CA : Example B C A DIFS Data frame SIFS ACK frame CNP3/2008.5. © O. Bonaventure, 2008
    68. 68. CSMA/CA : Example B C A DIFS Data frame Busy SIFS ACK frame CNP3/2008.5. © O. Bonaventure, 2008
    69. 69. CSMA/CA : Example B C A DIFS Data frame Busy SIFS ACK frame CNP3/2008.5. © O. Bonaventure, 2008
    70. 70. CSMA/CA : Example B C A DIFS Data frame Busy SIFS ACK frame DIFS Data frame CNP3/2008.5. © O. Bonaventure, 2008
    71. 71. CSMA/CA : Problem B C A CNP3/2008.5. © O. Bonaventure, 2008
    72. 72. CSMA/CA : Problem B C A DIFS DIFS CNP3/2008.5. © O. Bonaventure, 2008
    73. 73. CSMA/CA : Problem B C A DIFS DIFS Busy Data frame Data frame Busy CNP3/2008.5. © O. Bonaventure, 2008
    74. 74. CSMA/CA : Problem B C A DIFS DIFS Busy Data frame Data frame Busy Timeout Timeout CNP3/2008.5. © O. Bonaventure, 2008
    75. 75. CSMA/CA : Problem B C A DIFS DIFS Busy Data frame Data frame Busy Timeout Timeout Data frame Data frame Busy CNP3/2008.5. © O. Bonaventure, 2008
    76. 76. CSMA/CA First improvement (2)  Sender N=1; while ( N<= max) do if (previous frame corruped) { wait until channel free during t>=EIFS; } else { wait until endofframe; wait until channel free during t>=DIFS; } backoff_time = int(random[0,min(255,7*2N-1)])*T wait(backoff_time) if (channel still free) { send data frame ; wait for ack or timeout: if ack received exit while; else /* timeout retransmission is needed */ N=N+1; } end do CNP3/2008.5. © O. Bonaventure, 2008
    77. 77. CSMA/CA : Example 2 A B C CNP3/2008.5. © O. Bonaventure, 2008
    78. 78. CSMA/CA : Example 2 A B C DIFS DIFS CNP3/2008.5. © O. Bonaventure, 2008
    79. 79. CSMA/CA : Example 2 A B C DIFS DIFS Backoff[0,7] Backoff[0,7] CNP3/2008.5. © O. Bonaventure, 2008
    80. 80. CSMA/CA : Example 2 A B C DIFS DIFS Backoff[0,7] Backoff[0,7] Data frame SIFS Ack frame CNP3/2008.5. © O. Bonaventure, 2008
    81. 81. CSMA/CA : Example 2 A B C DIFS DIFS Backoff[0,7] Backoff[0,7] Data frame Channel busy! SIFS Busy Ack frame Data frame CNP3/2008.5. © O. Bonaventure, 2008
    82. 82. CSMA/CA : Example 2 A B C DIFS DIFS Backoff[0,7] Backoff[0,7] Data frame Channel busy! SIFS Busy Ack frame End of backoff Data frame CNP3/2008.5. © O. Bonaventure, 2008
    83. 83. CSMA/CA Hidden station problem  Often occurs in wireless networks B Hears A and C C A Only hears B, not C Hears B, but not A CNP3/2008.5. © O. Bonaventure, 2008
    84. 84. CSMA/CA Second improvement  Principle  Allow the sender to “reserve” some air time  Special (short) RTS frame indicates duration  Using a short RTS frame reduces the risk of collisions while transmitting this frame  Allow the receiver to confirm the reservation  Special (short) CTS frame indicates reservation  Using a short CTS frame reduces the risk of collisions while transmitting this frame  The stations that could collide with the transmission will hear at least CTS  Frame contains an indication of transmission time CNP3/2008.5. © O. Bonaventure, 2008
    85. 85. CSMA/CA : Example 3 A B C CNP3/2008.5. © O. Bonaventure, 2008
    86. 86. CSMA/CA : Example 3 A B C DIFS+Backoff CNP3/2008.5. © O. Bonaventure, 2008
    87. 87. CSMA/CA : Example 3 A B C DIFS+Backoff RTS [100 microsec] CNP3/2008.5. © O. Bonaventure, 2008
    88. 88. CSMA/CA : Example 3 A B C DIFS+Backoff RTS [100 microsec] SIFS CTS[100microsec] Busy[ 100microsec+ SIFS+ CTS+ SIFS+ ACK ] CNP3/2008.5. © O. Bonaventure, 2008
    89. 89. CSMA/CA : Example 3 A B C DIFS+Backoff RTS [100 microsec] SIFS CTS[100microsec] Busy[ 100microsec+ SIFS SIFS+ CTS+ Data [100 microsec] SIFS+ ACK ] SIFS ACK frame CNP3/2008.5. © O. Bonaventure, 2008
    90. 90. Datalink layer  Point-to datalink layer  Local area networks  Optimistic Medium access control  ALOHA, CSMA, CSMA/CD, CSMA/CA  Ethernet networks  Basics of Ethernet  IP over Ethernet  Interconnection of Ethernet networks  WiFi networks  Deterministic Medium access control CNP3/2008.5.  Token Ring, FDDI © O. Bonaventure, 2008
    91. 91. Ethernet/802.3  Most widely used LAN  First developed by Digital, Intel and Xerox  Standardised by IEEE and ISO  Medium Access Control  CSMA/CD with exponential backoff  Characteristics  Bandwidth: 10 Mbps  Two ways delay  51.2 microsec on Ethernet/802.3  => minimum frame size : 512 bits  Cabling  10Base5 : (thick) coaxial cable maximum 500 m,100 stations  10Base2 : (thin) coaxial 200 m maximum and 30 stations CNP3/2008.5. © O. Bonaventure, 2008
    92. 92. Ethernet/802.3 A B C D  Initial configuration  bus-shaped network  Remaining problems besides CSMA/CD  What is an Ethernet frame ?  How does station A sends a frame to station B ?  How does station B detects a frame  How to support broadcast ?  How to support multicast ? CNP3/2008.5. © O. Bonaventure, 2008
    93. 93. Ethernet Addresses (2)  Each Ethernet adapter has a unique Ethernet address  ensures that two hosts on the same LAN will not use the same Ethernet address  Ethernet Addressing format  48 bits addresses  Source Address 00 24 bits OUI 24 bits (adapter manufacturer) (identifier of adapter)  Destination address  If high order bit is 0, host unicast address  If high order bit is 1, host multicast address  broadcast address = 111111..111 CNP3/2008.5. © O. Bonaventure, 2008
    94. 94. LAN-level multicast  Principle  Two types of destination Ethernet addresses  Physical addresses  identifies one Ethernet adapter  Logical addresses  identifies a logical group of Ethernet destinations 48 bits OUI 0 : physical address (unicast) 1 : logical address (multicast)  Transmission of multicast frame  sender transmits frame with multicast destination addr.  Reception of multicast frames  Ethernet adapters can be configured to capture frames whose destination address is  Their unicast address  One of a set of multicast addresses CNP3/2008.5. © O. Bonaventure 2008
    95. 95. Ethernet Frames  DIX Format  proposed by Digital, Intel and Xerox Preamble [8 bytes] Destination address Source address Type [2 bytes] Data [46-1500 bytes CRC [32 bits] CNP3/2008.5. © O. Bonaventure, 2008
    96. 96. Ethernet Frames  DIX Format  proposed by Digital, Intel and Xerox Preamble Used to mark the beginning of the frame [8 bytes] Allows the receiver to synchronise its clock to the senderʼs clock Destination address Source address Type [2 bytes] Data [46-1500 bytes CRC [32 bits] CNP3/2008.5. © O. Bonaventure, 2008
    97. 97. Ethernet Frames  DIX Format  proposed by Digital, Intel and Xerox Preamble Used to mark the beginning of the frame [8 bytes] Allows the receiver to synchronise its clock to the senderʼs clock Destination address Source address Type Indication of the type of packet contained [2 bytes] inside the frame Data [46-1500 bytes CRC [32 bits] CNP3/2008.5. © O. Bonaventure, 2008
    98. 98. Ethernet Frames  DIX Format  proposed by Digital, Intel and Xerox Preamble Used to mark the beginning of the frame [8 bytes] Allows the receiver to synchronise its clock to the senderʼs clock Destination address Source address Type Indication of the type of packet contained [2 bytes] inside the frame Data Upper layer protocol must ensure that [46-1500 bytes the payload of the Ethernet frame is at least 46 bytes and at most 1500 bytes CRC [32 bits] CNP3/2008.5. © O. Bonaventure, 2008
    99. 99. 802.3 Frames Preamble [7 bytes] Delimiter[1byte] Destination Address Source Address Length [2 bytes] Data and padding [ 46- 1500 bytes] CRC [32 bits] CNP3/2008.5. © O. Bonaventure, 2008
    100. 100. 802.3 Frames Preamble Used to mark the beginning of the frame [7 bytes] Allows the receiver to synchronise its Delimiter[1byte] clock to the senderʼs clock Destination Address Source Address Length [2 bytes] Data and padding [ 46- 1500 bytes] CRC [32 bits] CNP3/2008.5. © O. Bonaventure, 2008
    101. 101. 802.3 Frames  Ethernet 802.3  standardised by IEEE Preamble Used to mark the beginning of the frame [7 bytes] Allows the receiver to synchronise its Delimiter[1byte] clock to the senderʼs clock Destination Address Source Address Length [2 bytes] Data and padding [ 46- 1500 bytes] CRC [32 bits] CNP3/2008.5. © O. Bonaventure, 2008
    102. 102. 802.3 Frames  Ethernet 802.3  standardised by IEEE Preamble Used to mark the beginning of the frame [7 bytes] Allows the receiver to synchronise its Delimiter[1byte] clock to the senderʼs clock Destination Address Source Address Provides the real length of the network Length layer packet placed inside the payload. [2 bytes] 802.3 adds padding (bytes set to 0) to ensure that the data field of the frame Data contains at least 46 bytes and padding [ 46- 1500 bytes] CRC [32 bits] CNP3/2008.5. © O. Bonaventure, 2008
    103. 103. Ethernet and 802.3 : details  How can the receiver identify the type of network protocol packet inside the frame ?  Ethernet : thanks to Type field  802.3 : no Type field !  IEEE standard  Divide datalink layer in two sublayers  Medium Access Control (MAC)  lower sublayer responsible for the frame transmission and medium access control (CSMA/CD)  interacts with but does not depend from the physical layer  example : 802.3  Logical Link Control (LLC)  higher sublayer responsible for the exchange of frames with the higher layers  interacts with the higher layer  does not depend from the MAC layer  several variants of LLC exist CNP3/2008.5. © O. Bonaventure, 2008
    104. 104. 802.2 : LLC  LLC Type 1  Unreliable connectionless service  Addition to 802.3  New LLC header allows to identify upper layer protocol  similar to Type field of Ethernet DIX Packet LLC Packet LLC P DA SA L LLC Packet CRC MAC  LLC Type 2  Reliable transmission with acknowledgements  An example of a protocol developed by a standardisation body but used by nobody... CNP3/2008.5. © O. Bonaventure, 2008
    105. 105. Ethernet Service  An Ethernet network provides a connectionless unreliable service  Transmission modes  unicast  multicast  broadcast  Even if in theory the Ethernet service is unreliable, a good Ethernet network should  deliver frames to their destination with a very hig probability of delivery  not reorder the transmitted frames  reordering is obviously impossible on a bus CNP3/2008.5. © O. Bonaventure, 2008
    106. 106. Datalink layer  Point-to datalink layer  Local area networks  Optimistic Medium access control  ALOHA, CSMA, CSMA/CD, CSMA/CA  Ethernet networks  Basics of Ethernet  IP over Ethernet  Interconnection of Ethernet networks  WiFi networks  Deterministic Medium access control CNP3/2008.5.  Token Ring, FDDI © O. Bonaventure, 2008
    107. 107. IPover PPP and IP over Ethernet IP: 10.0.0.1 Ethernet PPP IP: 10.0.1.9 IP: 10.0.0.2 R IP: 10.0.1.1 Eth : B Eth : A IP IP PPP PPP Eth Eth Modem Modem 10base5 10base5 CNP3/2008.5. © O. Bonaventure, 2008
    108. 108. IPover PPP and IP over Ethernet IP: 10.0.0.1 Ethernet PPP IP: 10.0.1.9 IP: 10.0.0.2 R IP: 10.0.1.1 Eth : B Eth : A IP IP PPP PPP Eth Eth Modem Modem 10base5 10base5 PPP Header IP Header PPP Trailer F Addr Ctrl Protocol S:10.0.0.1 D:10.0.1.9 CRC F 0xFF 0x0021 IP 0x8021 NCP for IP CNP3/2008.5. © O. Bonaventure, 2008
    109. 109. IPover PPP and IP over Ethernet IP: 10.0.0.1 Ethernet PPP IP: 10.0.1.9 IP: 10.0.0.2 R IP: 10.0.1.1 Eth : B Eth : A IP IP PPP PPP Eth Eth Modem Modem 10base5 10base5 PPP Header IP Header PPP Trailer F Addr Ctrl Protocol S:10.0.0.1 D:10.0.1.9 CRC F Ethernet header IP header Ethernet 0xFF 0x0021 IP 0x8021 NCP for IP P S:A D: B Type S:10.0.0.1 D:10.0.1.9 CRC 0x0800 IP CNP3/2008.5. © O. Bonaventure, 2008
    110. 110. IP on LANs  Problems to be solved  How to encapsulate IP packets in frames ?  How to find the LAN address of the IP destination ?  LAN efficiently supports broadcast/multicast transmission  When a host needs to find the LAN address of another IP host, it broadcasts a request  The owner of the destination IP address will reply and provided its LAN address  LAN doesnʼt efficiently support broadcast/ multicast  Maintain a server storing IP address:MAC address pairs  Each host knows serverʼs MAC address and registers its address pair  Each host sends request to server to map IP addresses CNP3/2008.5. © O. Bonaventure, 2008
    111. 111. Address Resolution Protocol 1 IP: 10.0.1.22 IP: 10.0.1.11 IP: 10.0.1.8 IP: 10.0.1.9 Eth : A Eth : E Eth : C Eth : B 10.0.1.22 needs to send an IP packet to 10.0.1.8 CNP3/2008.5. © O. Bonaventure, 2008
    112. 112. Address Resolution Protocol 1 IP: 10.0.1.22 IP: 10.0.1.11 IP: 10.0.1.8 IP: 10.0.1.9 Eth : A Eth : E Eth : C Eth : B 10.0.1.22 needs to send an IP packet to 10.0.1.8 2 IP: 10.0.1.22 IP: 10.0.1.11 IP: 10.0.1.8 IP: 10.0.1.9 Eth : A Eth : E Eth : C Eth : B ARP : broadcast frame Addr Eth 10.0.1.8 ? CNP3/2008.5. © O. Bonaventure, 2008
    113. 113. Address Resolution Protocol 1 IP: 10.0.1.22 IP: 10.0.1.11 IP: 10.0.1.8 IP: 10.0.1.9 Eth : A Eth : E Eth : C Eth : B 10.0.1.22 needs to send an IP packet to 10.0.1.8 2 IP: 10.0.1.22 IP: 10.0.1.11 IP: 10.0.1.8 IP: 10.0.1.9 Eth : A Eth : E Eth : C Eth : B ARP : broadcast frame Addr Eth 10.0.1.8 ? 3 IP: 10.0.1.22 IP: 10.0.1.11 IP: 10.0.1.8 IP: 10.0.1.9 Eth : A Eth : E Eth : C Eth : B 10.0.1.8 replies in an Ethernet frame and A knows the MAC address to send its IP packet CNP3/2008.5. © O. Bonaventure, 2008
    114. 114. ARP frame format Preamble [7 bytes] Delimiter[1byte] Destination Address Source Address Type: 0x806 Header Sender MAC Sender IP Target MAC Target IP CNP3/2008.5. CRC [32 bits] © O. Bonaventure, 2008
    115. 115. ARP frame format Preamble [7 bytes] Delimiter[1byte] Destination Broadcast : 111...111 Address Source Address Type: 0x806 Header Sender MAC Sender IP Target MAC Target IP CNP3/2008.5. CRC [32 bits] © O. Bonaventure, 2008
    116. 116. ARP frame format Preamble [7 bytes] Delimiter[1byte] Destination Broadcast : 111...111 Address Source MAC address of the sender Address Type: 0x806 Header Sender MAC Sender IP Target MAC Target IP CNP3/2008.5. CRC [32 bits] © O. Bonaventure, 2008
    117. 117. ARP frame format Preamble [7 bytes] Delimiter[1byte] Destination Broadcast : 111...111 Address Source MAC address of the sender Address Common header for all ARP frames Type: 0x806 - Hardware type  Ethernet is 1 - Protocol type , IP is 0x0800. Header - Hardware length : length of MAC address - Protocol length : length of network layer address Sender MAC - Operation : 1 for request, 2 for reply, 3 for RARP request, and 4 for RARP reply. Sender IP Target MAC Target IP CNP3/2008.5. CRC [32 bits] © O. Bonaventure, 2008
    118. 118. Optimisations  When should a host send ARP requests ?  Before sending each IP packet ?  No, each host/router maintains an ARP table that contains the mapping between IP addresses and Ethernet addresses. An ARP request is only sent when the ARP table is empty  How to deal with hosts that change their addresses ?  Expiration timer is associated to each entry in the ARP table  Line of ARP table is removed upon timer expiration.  Some implementations send an ARP request to revalidate it before removing the line  Some implementations remember when ARP lines have been used to avoid removing an important entry CNP3/2008.5. © O. Bonaventure, 2008
    119. 119. IP over Ethernet : Example IP: 10.0.1.9/24 IP: 10.0.1.8/24 Default R: 10.0.1.1 IP: 10.0.1.22/24 Default R: 10.0.1.1 Default R: 10.0.1.1 Eth : B Eth : C ARP Table Eth : A ARP Table ARP Table empty empty empty IP: 10.0.1.1/24 Eth : R ARP Table empty R  Transmission of an IP packet from 10.0.1.22 to 10.0.1.9  Transmission of an IP packet from 10.0.1.22 to 10.0.2.9 CNP3/2008.5. © O. Bonaventure, 2008
    120. 120. IPv6 over Ethernet  Neighbour discovery / address resolution 1 IPv6: 1080:0:0:0:8:A IPv6: 1080:0:0:0:8:E Ipv6: 1080:0:0:0:8:C Eth : A Eth : E Eth : C 1080:0:0:0:8:A wants to send a packet to 1080:0:0:0:8:C 2 IPv6: 1080:0:0:0:8:A IPv6: 1080:0:0:0:8:E Ipv6: 1080:0:0:0:8:C Eth : A Eth : E Eth : C Neighbor solicitation: Addr Eth 1080:0:0:0:8:C ? sent to IPv6 multicast address 3 IPv6: 1080:0:0:0:8:E IPv6: 1080:0:0:0:8:A Eth : A Eth : E Ipv6: 1080:0:0:0:8:C Eth : C Neighbor advertisement: 1080:0:0:0:8:C is reachable via Ethernet Add : C CNP3/2008.5. © O. Bonaventure 2008
    121. 121. ICMPv6 Neighbour Discovery • Replacement for IPv4ʼs ARP • Neighbour solicitation • Sent to Type : 135 Code:0 Checksum Reserved Target IPv6 Address • Neighbour advertisement Type : 136 Code:0 Checksum RSO Reserved Target IPv6 Address Target link layer Address CNP3/2008.5. © O. Bonaventure 2008
    122. 122. ICMPv6 Neighbour Discovery • Replacement for IPv4ʼs ARP • Neighbour solicitation • Sent to Type : 135 Code:0 Checksum The IPv6 address for which the link-layer Reserved (e.g. Ethernet) address is needed. Target IPv6 Address May also contain an optional field with the link-layer (e.g. Ethernet) address of the sender. • Neighbour advertisement Type : 136 Code:0 Checksum RSO Reserved Target IPv6 Address Target link layer Address CNP3/2008.5. © O. Bonaventure 2008
    123. 123. ICMPv6 Neighbour Discovery • Replacement for IPv4ʼs ARP • Neighbour solicitation • Sent to Type : 135 Code:0 Checksum The IPv6 address for which the link-layer Reserved (e.g. Ethernet) address is needed. Target IPv6 Address May also contain an optional field with the link-layer (e.g. Ethernet) address of the sender. • Neighbour advertisement Type : 136 Code:0 Checksum RSO Reserved The IPv6 and link-layer addresses Target IPv6 Address Target link layer Address CNP3/2008.5. © O. Bonaventure 2008
    124. 124. ICMPv6 Neighbour Discovery • Replacement for IPv4ʼs ARP • Neighbour solicitation • Sent to Type : 135 Code:0 Checksum The IPv6 address for which the link-layer Reserved (e.g. Ethernet) address is needed. Target IPv6 Address May also contain an optional field with the link-layer (e.g. Ethernet) address of the sender. • Neighbour advertisement R : true if node is a router S : true if answers to a neighbour solicitation Type : 136 Code:0 Checksum RSO Reserved The IPv6 and link-layer addresses Target IPv6 Address Target link layer Address CNP3/2008.5. © O. Bonaventure 2008
    125. 125. IPv6 autoconfiguration  How can a node obtain its IPv6 address ?  Manual configuration  From a server by using DHCPv6 as in IPv4 • Automatically • Router advertises prefix on LAN by sending ICMPv6 messages to “all IPv6 hosts” multicast address • Hosts build their address by concatenating the prefix with their MAC Address converted in 64 bits format CNP3/2008.5. © O. Bonaventure 2008
    126. 126. IPv6 autoconfiguration  How can a node obtain its IPv6 address ?  Manual configuration  From a server by using DHCPv6 as in IPv4 • Automatically • Router advertises prefix on LAN by sending ICMPv6 messages to “all IPv6 hosts” multicast address • Hosts build their address by concatenating the prefix with their MAC Address converted in 64 bits format R Prefix= 2001:6a8:3080:1/64 Ethernet : 0800:200C:417A CNP3/2008.5. © O. Bonaventure 2008
    127. 127. IPv6 autoconfiguration  How can a node obtain its IPv6 address ?  Manual configuration  From a server by using DHCPv6 as in IPv4 • Automatically • Router advertises prefix on LAN by sending ICMPv6 messages to “all IPv6 hosts” multicast address • Hosts build their address by concatenating the prefix with their MAC Address converted in 64 bits format R Prefix= 2001:6a8:3080:1/64 IPv6 address : 2001:6a8:3080:1:M64(800:200C:417A) Ethernet : 0800:200C:417A CNP3/2008.5. © O. Bonaventure 2008
    128. 128. Router advertisements Ver Tclass Flow Label Payload Length 58 255 Router IPv6 address (link local) FF02::1 (all nodes) Type:134 Code : 0 Checksum CurHLim M O Res Router lifetime Reachable Time Retrans Timer Options CNP3/2008.5. © O. Bonaventure 2008
    129. 129. Router advertisements Maximum hop limit to avoid spoofed packets from outside LAN Ver Tclass Flow Label Payload Length 58 255 Router IPv6 address (link local) FF02::1 (all nodes) Type:134 Code : 0 Checksum CurHLim M O Res Router lifetime Reachable Time Retrans Timer Options CNP3/2008.5. © O. Bonaventure 2008
    130. 130. Router advertisements Maximum hop limit to avoid spoofed packets from outside LAN Ver Tclass Flow Label Value of hop limit to be used by hosts when Payload Length 58 255 sending IPv6 packets Router IPv6 address (link local) FF02::1 (all nodes) Type:134 Code : 0 Checksum CurHLim M O Res Router lifetime Reachable Time Retrans Timer Options CNP3/2008.5. © O. Bonaventure 2008
    131. 131. Router advertisements Maximum hop limit to avoid spoofed packets from outside LAN Ver Tclass Flow Label Value of hop limit to be used by hosts when Payload Length 58 255 sending IPv6 packets Router IPv6 address The lifetime associated with the default router in (link local) units of seconds. 0 is the router sending the advertisement is not a default router. FF02::1 (all nodes) Type:134 Code : 0 Checksum CurHLim M O Res Router lifetime Reachable Time Retrans Timer Options CNP3/2008.5. © O. Bonaventure 2008
    132. 132. Router advertisements Maximum hop limit to avoid spoofed packets from outside LAN Ver Tclass Flow Label Value of hop limit to be used by hosts when Payload Length 58 255 sending IPv6 packets Router IPv6 address The lifetime associated with the default router in (link local) units of seconds. 0 is the router sending the advertisement is not a default router. FF02::1 (all nodes) The time, in milliseconds, that a node assumes a Type:134 Code : 0 Checksum neighbour is reachable after having received a CurHLim M O Res Router lifetime reachability confirmation. Reachable Time Retrans Timer The time, in milliseconds, between retransmitted Neighbor Solicitation messages. Options CNP3/2008.5. © O. Bonaventure 2008
    133. 133. Router advertisements Maximum hop limit to avoid spoofed packets from outside LAN Ver Tclass Flow Label Value of hop limit to be used by hosts when Payload Length 58 255 sending IPv6 packets Router IPv6 address The lifetime associated with the default router in (link local) units of seconds. 0 is the router sending the advertisement is not a default router. FF02::1 (all nodes) The time, in milliseconds, that a node assumes a Type:134 Code : 0 Checksum neighbour is reachable after having received a CurHLim M O Res Router lifetime reachability confirmation. Reachable Time Retrans Timer The time, in milliseconds, between retransmitted Neighbor Solicitation messages. Options MTU to be used on the LAN Prefixes to be used on the LAN CNP3/2008.5. © O. Bonaventure 2008
    134. 134. Router advertisements options • Format of the options Type Length Options Options (cont.) • MTU option Type : 5 Length:1 Reserved MTU • Prefix option Type : 3 Length:4 PreLen L A Res. Valid Lifetime Preferred Lifetime Reserved2 IPv6 prefix CNP3/2008.5. © O. Bonaventure 2008
    135. 135. Router advertisements options • Format of the options Type Length Options Options (cont.) • MTU option Type : 5 Length:1 Reserved MTU • Prefix option Type : 3 Length:4 PreLen L A Res. Number of bits in IPv6 prefix that identify subnet Valid Lifetime Preferred Lifetime Reserved2 IPv6 prefix CNP3/2008.5. © O. Bonaventure 2008
    136. 136. Router advertisements options • Format of the options Type Length Options Options (cont.) • MTU option Type : 5 Length:1 Reserved MTU • Prefix option Type : 3 Length:4 PreLen L A Res. Number of bits in IPv6 prefix that identify subnet Valid Lifetime Preferred Lifetime Reserved2 The validity period of the prefix in seconds IPv6 prefix CNP3/2008.5. © O. Bonaventure 2008
    137. 137. Router advertisements options • Format of the options Type Length Options Options (cont.) • MTU option Type : 5 Length:1 Reserved MTU • Prefix option Type : 3 Length:4 PreLen L A Res. Number of bits in IPv6 prefix that identify subnet Valid Lifetime Preferred Lifetime Reserved2 The validity period of the prefix in seconds IPv6 prefix The duration in seconds that addresses generated from the prefix via stateless address autoconfiguration remain preferred. CNP3/2008.5. © O. Bonaventure 2008
    138. 138. IPv6 autoconfiguration (2)  What happens when an endsystem boots ?  It knows nothing about its current network  but needs an IPv6 address to send ICMPv6 messages R Ethernet : 0800:200C:417A FE80::M64(800:200C:417A) ))  Use Link-local IPv6 address (FE80::/64)  Each host, when it boots, has a link-local IPv6 address  But another node might have chosen the same address ! CNP3/2008.5. © O. Bonaventure 2008
    139. 139. IPv6 autoconfiguration (2)  What happens when an endsystem boots ?  It knows nothing about its current network  but needs an IPv6 address to send ICMPv6 messages R ICMPv6 : Neighbour Solicitation Sent to multicast address Is someone using IPv6 address : Ethernet : 0800:200C:417A FE80::M64(800:200C:417A) ? FE80::M64(800:200C:417A) )) Address is valid if nobody answers  Use Link-local IPv6 address (FE80::/64)  Each host, when it boots, has a link-local IPv6 address  But another node might have chosen the same address ! CNP3/2008.5. © O. Bonaventure 2008
    140. 140. IPv6 autoconfiguration (2)  How to obtain the IPv6 prefix of the subnet ? • Wait for router advertisements (e.g. 30 seconds) • Solicit router advertisement R ICMPv6 : Router Solicitation IPv6 Src: FE80::M64(800:200C:417A) Ethernet : 0800:200C:417A IPv6 Dest: FF02::2 FE80::M64(800:200C:417A) CNP3/2008.5. © O. Bonaventure 2008
    141. 141. IPv6 autoconfiguration (3)  Router will re-advertise prefix R Ethernet : 0800:200C:417A FE80::M64(800:200C:417A)  IPv6 addresses can be allocated for limited lifetime  This allows IPv6 to easily support renumbering CNP3/2008.5. © O. Bonaventure 2008
    142. 142. IPv6 autoconfiguration (3)  Router will re-advertise prefix R ICMPv6 : Router Advertisement IPv6 Src: FE80::M64(EthernetR) IPv6 Dest: FF02::1 IPv6 Prefix = 2001:6a8:1100::/48 Ethernet : 0800:200C:417A Prefix lifetime FE80::M64(800:200C:417A)  IPv6 addresses can be allocated for limited lifetime  This allows IPv6 to easily support renumbering CNP3/2008.5. © O. Bonaventure 2008
    143. 143. Privacy issues with IPv6 address autoconfiguration • Issue • Autoconfigured IPv6 addresses contain the MAC address of the hosts • MAC addresses are fixed and unique • A laptop/user could be identified by tracking the lower 64 bits of its IPv6 addresses • How to maintain privacy with IPv6 ? • Use DHCPv6 and configure server to never reallocate the same IPv6 address • Allow hosts to use random host ids in lower 64 bits of their IPv6 address • algorithms have been implemented to generate such random host ids on nodes with and without stable storage CNP3/2008.5. © O. Bonaventure 2008
    144. 144. Datalink layer  Point-to datalink layer  Local area networks  Optimistic Medium access control  ALOHA, CSMA, CSMA/CD, CSMA/CA  Ethernet networks  Basics of Ethernet  IP over Ethernet  Interconnection of Ethernet networks  WiFi networks  Deterministic Medium access control CNP3/2008.5.  Token Ring, FDDI © O. Bonaventure, 2008
    145. 145. Ethernet today  The coaxial cable is not used anymore  Ethernet cabling today  Structured twisted pair cabling  Optical fiber for some point-to-point links  Ethernet organisation  Not anymore a bus  Ethernet is now a star-shaped network ! CNP3/2008.5. © O. Bonaventure, 2008

    ×