25. Hexadecimal - why do we care?
- Why hexadecimals are important?
- MAC Addresses are written in hexadecimal
- IPv6 is written in hexadecimal
- What is physical address?
- Physical address or in other words mac address
26. Hexadecimal - Lab demonstration
[[MAC Address]] is 48bit number.
- 12 hexadecimal values x 4 bit each = 48 bits
- 1st half of MAC address is usually manufacturers organizationally unique identifier (OUI).
- 2nd half is unique number.
- MAC addresses are usually written in one of the following formats:
- MMMM-MMSS-SSSS
- MM:MM:MM:SS:SS:SS
- [[ARP]] (Address Resolution Protocol) is used to find MAC address of another device in the network.
- ARP cache / ARP table maintains all the mapping between IP of the device and the MAC address.
- To identify the devices, we need to
pingthe destination device first - Then its MAC address will show with
arp -a show mac address-table- command to see Mac Addresses learned by the switch
27. Hexadecimal calculations (16:05)
Decimal is a Base 10 numbering system which uses 10 numbers
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Binary is Base 2 numbering system which uses 2 numbers:
- 0, 1
Hexadecimal is Base 16 which uses 16 numbers:
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
- A -> 10
- B -> 11
- C -> 12
- D -> 13
- E -> 14
- F -> 15
To convert Decimal into HEX:
- Convert Decimal into Binary
133 = 1000 0101 - Then convert each group into 1 Digit of HEX
1000 0101 1000 = 8+0+0+0 = 8 = 8 0101 = 0+4+0+1 = 5 = 5
HEX = 85
To convert Binary to HEX:
- Split Binary Output of 8 bits into groups of 4 bits
- Then convert each group into 1 Digit of HEX
Convert HEX to Decimal
-
Split HEX into 2 digits
F8
F 8 -
Convert each digit into Binary
F = 15 = 8+4+2+1=1111
8 = 8 = 8+0+0+0=1000 -
Convert binary into decimal
1111 1000 = 128+64+32+16+8 = ==248==
27.1 Quiz 2
- What is the decimal equivalent of hexadecimal E1?
- E = 14 = 8+4+2+0= 1110
- 1 = 1 = 0001
- 1110 0001 = 128 + 64 + 32 + 1 = 225
- 225
- What is the hexadecimal equivalent of decimal 199?
- 199 = 128 + 64 = 192 + 4 + 2 + 1 = 1100 0111
- 1100 = 8+4+0+0= 12 = C
- 0111 = 4+2+1=7
- C7
- What is the hexadecimal equivalent of decimal 229?
- 229 = 128+64+32=224+0+0+4+0+1=11100101
- 1110 = 14 = E
- 0101= 5
- E5
- What is the decimal equivalent of hexadecimal E9?
- E = 14 = 8+4+2+0= 1110
- 9 = 8+0+0+1 = 1001
- 1110 1001 = 128+64+32+0+8+0+0+1 = 233
- What is the hexadecimal equivalent of 10.1.12.123?
- 10 = A -> 0A
- 1 = 1 -> 01
- 12 = C -> 0C
- 123 = 0+64+32=96+16=112+8=220+0+2+1= 01111011
- 0111= 7
- 1011=11
- 7B
- What is the decimal equivalent of hexadecimal AB?
- A = 10 -> 1010
- B = 11 -> 1011
- 1011 1011 -> 128+0+32+16+8+0+2+1=171
- 171
- What is the hexadecimal equivalent of 12.254.234.133?
- 12 -> C -> 0C
- 254 -> 1111 1110 -> FE
- 234 -> 1110 1010 -> EA
- 133 -> 1000 0101 -> 85
Flashcards/Active Recall Q+A:
Why hexadecimals are important? #card
- MAC Addresses are written in hexadecimal
- IPv6 is written in hexadecimal
What is physical address? #card
- Physical address or in other words [[mac address]]
How many bit is [[MAC Address]]? #card
- [[MAC Address]] is 48bit long = 12 hexadecimal values x 4bit each.
- MMMM-MMSS-SSSS e.g. 0050-56C0-0008
- 0000 0000 -> 00
- 01010000 -> 50
- 01010110 -> 56
- 11000000 -> C0
- 00000000 -> 00
- 00001000 -> 08
What is [[MAC Address]] ? #card
- 12 hexadecimal values x 4 bit each = 48 bits
- 1st half of MAC address is usually manufacturers organizationally unique identifier (OUI).
- 2nd half is unique number.
- MAC addresses are usually written in one of the following formats:
- MMMM-MMSS-SSSS
- MM:MM:MM:SS:SS:SS
What is [[ARP]]? #card
- ARP(Address Resolution Protocol) is used to find MAC Addresses of other devices in the network.
What is [[ARP cache]]? #card
- ARP cache contains all the entries that map IP Addresses to MAC addresses.
- ARP cache can contain dynamic (learned) entries and static (user-configures) entries. The software places a dynamic entry in the ARP cache when it learns a devices MAC address from ARP request or ARP reply from the device. e.g. after `ping` 'ing the destination device.
How to view [[ARP cache]] ? #card
- `arp -a`
- `show mac address-table` - command to see Mac Addresses learned by the switch
What are [[Base 2]], [[Base 10]], [[Base 16]] numbering systems? #card
- Base 2 consists of 2 numbers 0 or 1. It is Binary.
- Base 10 consists of 10 numbers 0, 1,2,3,4,5,6,7,8,9 -> Decimal
- Base 16 consists of 16 numbers -> hexadecimal
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
- A -> 10
- B -> 11
- C -> 12
- D -> 13
- E -> 14
- F -> 15
How to convert Decimal into HEX? #card
-
Convert Decimal into Binary
133 = 1000 0101 -
Then convert each group into 1 Digit of HEX
1000 0101
1000 = 8+0+0+0 = 8 = 8
0101 = 0+4+0+1 = 5 = 5
HEX = 85
How to convert HEX to Decimal? #card
-
Split HEX into 2 digits
F8
F 8
-
Convert each digit into Binary
F = 15 = 8+4+2+1=1111
= 8 = 8+0+0+0=1000
-
Convert binary into decimal
1000 = 128+64+32+16+8 = 248
What is the decimal equivalent of hexadecimal E1? #card
- E = 14 = 8+4+2+0= 1110
- 1 = 1 = 0001
- 1110 0001 = 128 + 64 + 32 + 1 = 225
- 225
What is the hexadecimal equivalent of decimal 199? #card
- 199 = 128 + 64 = 192 + 4 + 2 + 1 = 1100 0111
- 1100 = 8+4+0+0= 12 = C
- 0111 = 4+2+1=*7*
- C7
What is the decimal equivalent of hexadecimal AB? #card
- A = 10 -> 1010
- B = 11 -> 1011
- 1011 1011 -> 128+0+32+16+8+0+2+1=171
- 171
One Page Summary
MAC address, ARP, ARP cache, Binary, Decimal, Hexadecimal.