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
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
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 1 / 62
Overview
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 2 / 62
Overview
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 3 / 62
Overview
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 4 / 62
Overview
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 5 / 62
Overview
◮ Naval Research Lab (US) ◮ INRIA (France) ◮ Kame (Japan)
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 6 / 62
IPv6 Differences
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 7 / 62
IPv6 Differences
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 8 / 62
IPv6 Differences
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 9 / 62
IPv6 Differences
◮ Two 4 bit fields ◮ One 3 bit field ◮ One 13 bit field ◮ Options
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 10 / 62
IPv6 Differences
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 11 / 62
IPv6 Differences
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 12 / 62
IPv6 Differences
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 13 / 62
IPv6 Differences
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 14 / 62
IPv6 Differences
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 15 / 62
IPv6 Differences
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 16 / 62
Code Overview
◮ icmp6.h ◮ ip6.h George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 17 / 62
Code Overview
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 18 / 62
Code Overview
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 19 / 62
Code Overview
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 20 / 62
Code Overview
◮ See locking(9) for more information George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 21 / 62
Code Overview
◮ Examined at the endpoint.
◮ Examined at each intermediate hop George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 22 / 62
Code Overview
123 struct sockaddr_in6 { 124 u i n t8 _ t sin6_len ; /∗ length
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
Code Overview
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
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
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
Code Overview
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
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
Code Overview
115 struct ip6_ext { 116 u_int8_t ip6e_nxt ; 117 u_int8_t ip6e_len ; 118 } __packed ; 232 /∗ Fragment header ∗/ 233 struct ip6_frag { 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 ; /∗
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
Code Overview
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 27 / 62
Code Overview
122 struct ip6_hbh { 123 u_int8_t ip6h_nxt ; /∗ next header ∗/ 124 u_int8_t ip6h_len ; /∗ length in units
∗/ 125 /∗ followed by options ∗/ 126 } __packed ; 169 /∗ Jumbo Payload Option ∗/ 170 struct ip6_opt_jumbo { 171 u_int8_t ip6oj_type ; 172 u_int8_t ip6oj_len ; 173 u_int8_t ip6oj_jumbo_len [ 4 ] ; 174 } __packed ; George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 28 / 62
IPv6 Packet Reception and Transmission
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 29 / 62
IPv6 Packet Reception and Transmission
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 30 / 62
IPv6 Packet Reception and Transmission
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 31 / 62
IPv6 Packet Reception and Transmission
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 32 / 62
IPv6 Packet Reception and Transmission
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 33 / 62
IPv6 Packet Reception and Transmission
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 34 / 62
IPv6 Packet Reception and Transmission
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 35 / 62
IPv6 Packet Reception and Transmission
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 36 / 62
IPv6 Packet Reception and Transmission
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 37 / 62
Autoconfiguration
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 38 / 62
Autoconfiguration
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 39 / 62
Autoconfiguration
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 40 / 62
Autoconfiguration
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 41 / 62
Autoconfiguration
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 42 / 62
Autoconfiguration
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 43 / 62
Autoconfiguration
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 44 / 62
Autoconfiguration
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 45 / 62
Autoconfiguration
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 46 / 62
Autoconfiguration
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 47 / 62
Autoconfiguration
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 48 / 62
Security Protocols
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 49 / 62
Security Protocols
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 50 / 62
Security Protocols
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 51 / 62
Security Protocols
◮ xform_ah.[ch], xform_esp.[ch]
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 52 / 62
Security Protocols
82 struct xformsw { 83 u_short xf_type ; /∗ xform ID ∗/ 84 #define XF_IP4 1 /∗ IP inside IP ∗/ 85 #define XF_AH 2 /∗ AH ∗/ 86 #define XF_ESP 3 /∗ ESP ∗/ 87 #define XF_TCPSIGNATURE 5 /∗ TCP MD5 Signature
88 #define XF_IPCOMP 6 /∗ IPCOMP ∗/ 89 u_short x f _ f l a g s ; 90 #define XFT_AUTH 0x0001 91 #define XFT_CONF 0x0100 92 #define XFT_COMP 0x1000 93 char ∗xf_name ; /∗ human −readable name ∗/ 94 int (∗ x f _ i n i t ) ( struct secasvar ∗, struct xformsw ∗); /∗ setup ∗/ 95 int (∗ xf_zeroize ) ( struct secasvar ∗); /∗ cleanup ∗/ 96 int (∗ xf_input ) ( struct mbuf∗, struct secasvar ∗, /∗ input ∗/ 97 int , int ) ; 98 int (∗ xf_output ) ( struct mbuf∗, /∗
∗/ 99 struct ipsecrequest ∗, struct mbuf ∗∗, int , int ) ; 100 struct xformsw ∗xf_next ; /∗ l i s t
registered xforms ∗/ 101 } ; 1205 static struct xformsw ah_xformsw = { 1206 XF_AH, XFT_AUTH, " IPsec AH" , 1207 ah_init , ah_zeroize , ah_input , ah_output , 1208 } ; George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 53 / 62
Security Protocols
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 54 / 62
Security Protocols
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 55 / 62
Security Protocols
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 56 / 62
Security Protocols
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 57 / 62
Security Protocols
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 58 / 62
Security Protocols
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 59 / 62
Security Protocols
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 60 / 62
Security Protocols
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 61 / 62
Security Protocols
George Neville-Neil (gnn@neville-neil.com) Networking from the Bottom Up: IPv6 May 8, 2010 62 / 62