networking from the bottom up ipv6
play

Networking from the Bottom Up: IPv6 George Neville-Neil - PowerPoint PPT Presentation

Networking from the Bottom Up: IPv6 George Neville-Neil gnn@neville-neil.com May 8, 2010 George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 1 / 62 Overview What We Will Cover A bit of the History


  1. Networking from the Bottom Up: IPv6 George Neville-Neil gnn@neville-neil.com May 8, 2010 George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 1 / 62

  2. Overview What We Will Cover ◮ A bit of the History and Goals of IPv6 ◮ IPv6 Protocol Code ◮ Neighbor Discovery ◮ Router Discovery ◮ ICMPv6 ◮ IPSec George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 2 / 62

  3. Overview What We Will Not Cover ◮ Routing ◮ TCPv6 ◮ UDPv6 ◮ SCTP (See Randall Stewart’s excellent tutorial.) George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 3 / 62

  4. Overview What Problem Are You Trying To Solve? ◮ Running out of addresses ◮ Efficiency ◮ Manageability ◮ Security George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 4 / 62

  5. Overview Protocol Historical Context ◮ Early 90s move to classless inter domain routing (CIDR) ◮ 1990: RFC 1287 Future Internet Architecture ◮ 1992: RFC 1335 Discusses exhaustion issue ◮ 1995: First IPv6 RFCs ◮ 1998: First acceptable IPv6 RFCs (2460 et al) George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 5 / 62

  6. Overview Code History ◮ Originally three open source implementations of IPv6 ◮ Naval Research Lab (US) ◮ INRIA (France) ◮ Kame (Japan) ◮ Kame Project Wins out over the other two ◮ All work originally done in the BSD community ◮ Largest and riskiest kernel sub system developed outside of the BSD projects ◮ Kame Project ends active development in 2007 ◮ Code fully taken over by the relevant OS projects George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 6 / 62

  7. IPv6 Differences IPv6 Differences ◮ Addresses ◮ MTU ◮ Header Processing ◮ Scoping ◮ Multicast ◮ Autoconfiguration George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 7 / 62

  8. IPv6 Differences Addresses ◮ The most obvious and talked about change ◮ 128 bits for the host address ◮ IPv4 didn’t have enough for everyone alive ◮ IPv6 has enough for every atom in the universe George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 8 / 62

  9. IPv6 Differences MTU ◮ Maximum Transfer Unit ◮ IP is a hop by hop, packet switched protocol ◮ Fragmentation was seen as a problem ◮ Having an end to end MTU improves performance George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 9 / 62

  10. IPv6 Differences Header Processing ◮ The IPv4 header is messy ◮ Two 4 bit fields ◮ One 3 bit field ◮ One 13 bit field ◮ Options ◮ Make the header as simple as possible ◮ Have the packet look like a linked list George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 10 / 62

  11. IPv6 Differences Scoping ◮ A novel way of asking the local/remote question ◮ An attempt to replace subnetting within organizations ◮ Too complicated for many uses George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 11 / 62

  12. IPv6 Differences Multicast ◮ More efficient than broadcast ◮ Available in most common data-link protocols ◮ Used heaving in auto configuration George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 12 / 62

  13. IPv6 Differences Autoconfiguration ◮ Trying to solve the Dentist’s Office ◮ Does anyone still create isolated networks? ◮ Introduces new problems George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 13 / 62

  14. IPv6 Differences Neighbor Discovery ◮ Replacement for ARP ◮ Partial replacement for DHCP ◮ Removal of a layering violation George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 14 / 62

  15. IPv6 Differences Router Discovery ◮ Lessens the burden of administrators ◮ Partial replacement for DHCP George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 15 / 62

  16. IPv6 Differences Sockets API ◮ A by-product of some of the changes ◮ Overcome problems with socket addressing George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 16 / 62

  17. Code Overview Directories and Files ◮ Majority of the code resides in sys/netinet6 ◮ Two files present in sys/netinet ◮ icmp6.h ◮ ip6.h George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 17 / 62

  18. Code Overview Memory for Packets ◮ Packets need to be stored for reception and transmission ◮ The basic packet memory stuctures are the mbuf and cluster ◮ mbuf structures have several types and purposes ◮ Clusters hold only data ◮ History dictates that mbuf s are named m ◮ In the kernel we will see many pointers to mbuf s George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 18 / 62

  19. Code Overview Types of mbufs ◮ Wholly contained ◮ Packet Header ◮ Using a cluster George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 19 / 62

  20. Code Overview Welcome to SMP ◮ FreeBSD is a multi-threaded, re-entrant kernel ◮ Only way to scale on multicore and multi-processor systems ◮ Kernel is full of cooperating tasks ◮ Inter process synchronization is required George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 20 / 62

  21. Code Overview Kernel Synchronization Primitives ◮ Spin Locks ◮ Mutexes ◮ Reader/Writer Locks ◮ Shared/Exclusive Locks ◮ Drivers use mostly spin locks or mutexes ◮ See locking(9) for more information George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 21 / 62

  22. Code Overview IPv6 Specific Data Structures ◮ Addresses ◮ Packet Header ◮ Extension Headers ◮ Examined at the endpoint. ◮ Hop by Hop Options ◮ Examined at each intermediate hop George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 22 / 62

  23. Code Overview Address Structures 123 sockaddr_in6 { struct 124 u i n t8 _ t sin6_len ; / ∗ length of t h i s s t r u c t ∗ / 125 sa_family_t sin6_family ; / ∗ AF_INET6 ∗ / 126 i n _ p o r t _ t sin6_port ; / ∗ Transport layer port # ∗ / 127 uint32_t sin6_flowinfo ; / ∗ IP6 flow information ∗ / 128 struct in6_addr sin6_addr ; / ∗ IP6 address ∗ / 129 uint32_t sin6_scope_id ; / ∗ scope zone index ∗ / 130 } ; 95 struct in6_addr { 96 union { 97 ui n t 8_ t __u6_addr8 [ 1 6 ] ; 98 uint16_t __u6_addr16 [ 8 ] ; 99 uint32_t __u6_addr32 [ 4 ] ; 100 } __u6_addr ; / ∗ 128 − b i t IP6 address ∗ / 101 } ; George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 23 / 62

  24. Code Overview IPv4 Header 49 struct ip { 50 # i f BYTE_ORDER == LITTLE_ENDIAN 51 u_int ip_hl :4 , / ∗ header length ∗ / 52 ip_v : 4 ; / ∗ version ∗ / 53 #endif 54 # i f BYTE_ORDER == BIG_ENDIAN 55 u_int ip_v :4 , / ∗ version ∗ / 56 ip_hl : 4 ; / ∗ header length ∗ / 57 #endif 58 u_char ip_tos ; / ∗ type of service ∗ / 59 u_short ip_len ; / ∗ t o t a l length ∗ / 60 u_short ip_id ; / ∗ i d e n t i f i c a t i o n ∗ / 61 u_short i p _ o f f ; / ∗ fragment o f f s e t f i e l d ∗ / 62 #define IP_RF 0x8000 / ∗ reserved fragment f l a g ∗ / 63 #define IP_DF 0x4000 / ∗ dont fragment f l a g ∗ / 64 #define IP_MF 0x2000 / ∗ more fragments f l a g ∗ / 65 #define IP_OFFMASK 0 x 1 f f f / ∗ mask f o r fragmenting b i t s ∗ / 66 u_char i p _ t t l ; / ∗ time to l i v e ∗ / 67 u_char ip_p ; / ∗ protocol ∗ / 68 u_short ip_sum ; / ∗ checksum ∗ / 69 struct in_addr ip_src , ip_dst ; / ∗ source and dest address ∗ / 70 } __packed __aligned ( 4 ) ; George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 24 / 62

  25. Code Overview IPv6 Header 72 struct ip6_hdr { 73 union { 74 struct i p 6 _ h d r c t l { 75 u_int32_t ip6_un1_flow ; / ∗ 20 b i t s of flow − ID ∗ / 76 u_int16_t ip6_un1_plen ; / ∗ payload length ∗ / 77 u_int8_t ip6_un1_nxt ; / ∗ next header ∗ / 78 u_int8_t ip6_un1_hlim ; / ∗ hop l i m i t ∗ / 79 } ip6_un1 ; 80 u_int8_t ip6_un2_vfc ; / ∗ 4 b i t s version , top 4 b i t s class ∗ / 81 } ip6_ctlun ; 82 struct in6_addr ip6_src ; / ∗ source address ∗ / 83 struct in6_addr ip6_dst ; / ∗ destination address ∗ / 84 } __packed ; George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 25 / 62

  26. Code Overview Extension Header Structure 115 struct ip6_ext { 116 u_int8_t ip6e_nxt ; 117 u_int8_t ip6e_len ; 118 } __packed ; 232 / ∗ Fragment header ∗ / 233 ip6_frag { struct 234 u_int8_t ip6f_nxt ; / ∗ next header ∗ / 235 u_int8_t ip6f_reserved ; / ∗ reserved f i e l d ∗ / 236 u_int16_t i p 6 f _ o f f l g ; / ∗ offset , reserved , and f l a g ∗ / 237 u_int32_t i p 6 f _ i d e n t ; / ∗ i d e n t i f i c a t i o n ∗ / 238 } __packed ; George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 26 / 62

Recommend


More recommend