1 00:00:06,870 --> 00:00:09,360 - You have just learned how to work with IPv4. 2 00:00:09,360 --> 00:00:12,930 And in most cases, IPv4 is what you will be using. 3 00:00:12,930 --> 00:00:15,870 But it's a fact that the world 4 00:00:15,870 --> 00:00:18,510 is running out of IPv4 addresses. 5 00:00:18,510 --> 00:00:21,030 And that is why there is a next version of IP, 6 00:00:21,030 --> 00:00:23,070 and that's IPv6. 7 00:00:23,070 --> 00:00:25,980 In case you are wondering what happened to IPv5, 8 00:00:25,980 --> 00:00:28,890 well, it was proposed one day, but it never made it. 9 00:00:28,890 --> 00:00:30,780 So we skipped IPv5. 10 00:00:30,780 --> 00:00:32,853 Nobody ever heard about it anymore. 11 00:00:33,720 --> 00:00:38,720 In IPv6, 128 bits is used 12 00:00:38,850 --> 00:00:40,290 to write the addresses, 13 00:00:40,290 --> 00:00:44,040 and the addresses are written in a hexadecimal way. 14 00:00:44,040 --> 00:00:49,040 Hexadecimal is a numbering system from 0 up to 15. 15 00:00:49,080 --> 00:00:51,240 And in order to use that numbering system, 16 00:00:51,240 --> 00:00:53,220 we use the number zero up to nine, 17 00:00:53,220 --> 00:00:57,300 and then a, b, c, d, e, and f as the additional numbers. 18 00:00:57,300 --> 00:00:59,190 And that makes it what we see right here. 19 00:00:59,190 --> 00:01:01,383 It's a valid IPv6 address. 20 00:01:02,400 --> 00:01:07,113 As you can see, these are not so easy to work with. 21 00:01:07,950 --> 00:01:11,640 In an IPv6 address, you can omit leading zeros, 22 00:01:11,640 --> 00:01:14,250 as well as long string of zeros. 23 00:01:14,250 --> 00:01:19,250 So fe80::1 is a valid address. 24 00:01:20,010 --> 00:01:23,010 That just means that the address starts with fe80, 25 00:01:23,010 --> 00:01:25,860 and then, there's a whole lot of zeros 26 00:01:25,860 --> 00:01:27,720 and it ends with a one. 27 00:01:27,720 --> 00:01:31,350 Fortunately, you can summarize the IPv6 addresses 28 00:01:31,350 --> 00:01:35,070 to make it a little bit more manageable. 29 00:01:35,070 --> 00:01:38,400 When you are referring to an address followed by the port, 30 00:01:38,400 --> 00:01:41,130 then you need to put the address between square brackets, 31 00:01:41,130 --> 00:01:42,990 as in this example 32 00:01:42,990 --> 00:01:47,940 where you can see port 80 on fe80::1. 33 00:01:47,940 --> 00:01:51,390 And it's quite obvious why you need the square brackets. 34 00:01:51,390 --> 00:01:54,690 That is because the colon has a meaning 35 00:01:54,690 --> 00:01:56,310 in a network socket. 36 00:01:56,310 --> 00:01:57,420 In a network socket, 37 00:01:57,420 --> 00:02:00,180 which consists of IP address followed by port, 38 00:02:00,180 --> 00:02:02,640 the colon is normally used as a separator. 39 00:02:02,640 --> 00:02:06,180 But in IPv6, the colon is also used as a separator. 40 00:02:06,180 --> 00:02:09,363 Well, to avoid any confusion, we have the square brackets. 41 00:02:10,350 --> 00:02:13,470 In IPv6, we have a default subnet mask. 42 00:02:13,470 --> 00:02:16,203 The subnet mask distinguish between the part of the address 43 00:02:16,203 --> 00:02:18,540 that is used as the network address 44 00:02:18,540 --> 00:02:21,060 and the part that is used as the node address. 45 00:02:21,060 --> 00:02:24,450 And by default, the subnet mask is /64. 46 00:02:24,450 --> 00:02:26,820 So the first half is for the network, 47 00:02:26,820 --> 00:02:28,743 the second half is for the node. 48 00:02:29,940 --> 00:02:31,950 And the node bit of the address 49 00:02:31,950 --> 00:02:34,590 may contain the device MAC address. 50 00:02:34,590 --> 00:02:38,100 And that's because IPv6 has this nice solution 51 00:02:38,100 --> 00:02:40,833 to automatically assign IP addresses. 52 00:02:41,910 --> 00:02:44,610 Now, in IPv6, there's a couple of IP addresses 53 00:02:44,610 --> 00:02:45,720 that are reserved. 54 00:02:45,720 --> 00:02:47,580 Let's talk about those. 55 00:02:47,580 --> 00:02:49,800 To start with, there is ::1, 56 00:02:49,800 --> 00:02:54,210 which is the equivalent to IPv4 127001. 57 00:02:54,210 --> 00:02:56,730 That's a localhost IP address. 58 00:02:56,730 --> 00:03:00,120 There is ::, which is the unspecified address, 59 00:03:00,120 --> 00:03:01,953 000 in IPv4. 60 00:03:03,000 --> 00:03:07,260 And ::/0 refers to the default route. 61 00:03:07,260 --> 00:03:09,600 And then there is a couple of addresses 62 00:03:09,600 --> 00:03:12,450 that are reserved as well. 63 00:03:12,450 --> 00:03:17,220 Anything starting with 2000 and a subnet mask /3 64 00:03:17,220 --> 00:03:20,550 is what we call the global unicast address. 65 00:03:20,550 --> 00:03:22,410 The global unicast address 66 00:03:22,410 --> 00:03:24,900 is a worldwide unique address 67 00:03:24,900 --> 00:03:27,540 that can be used on the Internet. 68 00:03:27,540 --> 00:03:31,230 And the IPv6, folks, have done something smart. 69 00:03:31,230 --> 00:03:32,850 And that is, they have reserved 70 00:03:32,850 --> 00:03:35,970 a couple of IPv6 addresses only. 71 00:03:35,970 --> 00:03:39,570 Anything starting with 2000/3. 72 00:03:39,570 --> 00:03:42,750 And that means that a lot of IPv6 addresses 73 00:03:42,750 --> 00:03:44,910 are not used at all at the moment. 74 00:03:44,910 --> 00:03:46,353 They are for future use. 75 00:03:47,520 --> 00:03:51,060 And we can do that because in IPv6, 76 00:03:51,060 --> 00:03:54,540 given the 128 bits address space, 77 00:03:54,540 --> 00:03:59,130 you can use an incredible lot of IPv6 addresses. 78 00:03:59,130 --> 00:04:00,120 To be precise, 79 00:04:00,120 --> 00:04:04,020 4 billion times 4 billion times 4 billion times 4 billion. 80 00:04:04,020 --> 00:04:07,440 You try to pronounce the result of that. 81 00:04:07,440 --> 00:04:09,870 I don't know how to pronounce it. 82 00:04:09,870 --> 00:04:14,550 Back to the reserved IPv6 addresses, there is fd00. 83 00:04:14,550 --> 00:04:18,420 These are unique local addresses or private addresses. 84 00:04:18,420 --> 00:04:22,080 And these private addresses can be used for internal use. 85 00:04:22,080 --> 00:04:27,080 So it's a little bit like 192 168 in IPv4. 86 00:04:27,120 --> 00:04:28,680 Then we have fe80. 87 00:04:28,680 --> 00:04:32,400 fe80 is for link-local addresses. 88 00:04:32,400 --> 00:04:33,780 And link-local addresses 89 00:04:33,780 --> 00:04:36,480 are addresses that are automatically assigned. 90 00:04:36,480 --> 00:04:38,430 You don't have to assign them yourself. 91 00:04:38,430 --> 00:04:41,880 These are addresses that are created automatically 92 00:04:41,880 --> 00:04:43,110 based on the MAC address 93 00:04:43,110 --> 00:04:46,050 that was found on your network interface. 94 00:04:46,050 --> 00:04:48,270 And because these IPv6 addresses 95 00:04:48,270 --> 00:04:50,430 are created automatically, 96 00:04:50,430 --> 00:04:54,180 you get the default IPv6 functionality within your network, 97 00:04:54,180 --> 00:04:56,100 and that's convenient. 98 00:04:56,100 --> 00:05:00,573 And finally, there is ff00, which is a multicast address. 99 00:05:02,010 --> 00:05:05,130 Now, how do we get an IPv6 address? 100 00:05:05,130 --> 00:05:07,230 Well, you will notice that interfaces, 101 00:05:07,230 --> 00:05:10,260 by default have an fe80 address. 102 00:05:10,260 --> 00:05:13,590 You can also do a static addressing. 103 00:05:13,590 --> 00:05:16,950 That is where you are going to assign them yourselves. 104 00:05:16,950 --> 00:05:20,100 And you can use DHCPv6. 105 00:05:20,100 --> 00:05:23,670 Now, in DHCPv6, the IPv6 client 106 00:05:23,670 --> 00:05:28,000 sends out a multicast address to ff02::1:2 107 00:05:31,320 --> 00:05:33,420 on port 547. 108 00:05:33,420 --> 00:05:36,090 That is the all-DHCP multicast group. 109 00:05:36,090 --> 00:05:40,260 And if the DHCP server is listening, it will answer. 110 00:05:40,260 --> 00:05:43,980 The other option is stateless address auto configuration. 111 00:05:43,980 --> 00:05:45,360 Now, how does that work? 112 00:05:45,360 --> 00:05:47,490 Well, the IPv6 client 113 00:05:47,490 --> 00:05:50,940 is sending a so-called router solicitation 114 00:05:50,940 --> 00:05:54,660 to the multicast address ff02:2. 115 00:05:54,660 --> 00:05:57,570 And that is the all-routers multicast group. 116 00:05:57,570 --> 00:06:00,870 And if there's a router that is configured with IPv6, 117 00:06:00,870 --> 00:06:05,870 then it will answer back with its IP address 118 00:06:05,880 --> 00:06:09,120 that allows the host to learn the network prefix, 119 00:06:09,120 --> 00:06:11,980 and it will automatically create its own IP address 120 00:06:13,170 --> 00:06:14,520 by creating the node port 121 00:06:14,520 --> 00:06:17,670 based on the MAC address of that network card. 122 00:06:17,670 --> 00:06:19,530 Sounds a little bit complicated, 123 00:06:19,530 --> 00:06:21,330 but in fact, it's really simple. 124 00:06:21,330 --> 00:06:24,480 You have a node that needs an IPv6 address, 125 00:06:24,480 --> 00:06:26,040 it is going to come up, 126 00:06:26,040 --> 00:06:27,960 it sends a message over the network, 127 00:06:27,960 --> 00:06:29,137 and its message is like, 128 00:06:29,137 --> 00:06:31,500 "Hey, is there a router that can help me?" 129 00:06:31,500 --> 00:06:33,810 And if there is a router that can help, 130 00:06:33,810 --> 00:06:35,250 the router will answer. 131 00:06:35,250 --> 00:06:36,240 And in the answer, 132 00:06:36,240 --> 00:06:39,720 the requesting node will learn the network IP address 133 00:06:39,720 --> 00:06:42,090 and it's assigning its own node ID to it, 134 00:06:42,090 --> 00:06:45,723 and you have an automatically created IPv6 address. 135 00:06:46,800 --> 00:06:48,240 The only requirement 136 00:06:48,240 --> 00:06:51,750 is that you need a stateless address auto configuration 137 00:06:51,750 --> 00:06:53,550 compatible router. 138 00:06:53,550 --> 00:06:55,680 On Linux, you can create such a router 139 00:06:55,680 --> 00:07:00,660 by installing radvd package on the Linux node. 140 00:07:00,660 --> 00:07:03,780 But Linux is not used commonly as a router 141 00:07:03,780 --> 00:07:05,790 so you probably have a Cisco router 142 00:07:05,790 --> 00:07:07,690 or something else taking care of this.