ption: In this programming, your goal is to create a C program that can be used to check the validity and analyse a given MAC address. You will mainly do the following. You will ask the user to enter a MAC address and you will check if it is valid. If it is valid you will allow the user to analyse the given MAC address.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%

Description:

In this programming, your goal is to create a C program that can be used to check

the validity and analyse a given MAC address. You will mainly do the following. You will ask the

user to enter a MAC address and you will check if it is valid. If it is valid you will allow the user to

analyse the given MAC address.

Programming Requirements:
Media Access Control (MAC) Addresses are unique hardware number of a computer, which is
embedded into network card during the time of manufacturing and also known as Physical
Address of a network device. MAC Address is a 12-digit hexadecimal number, which is
represented by Colon-Hexadecimal notation. An example valid MAC address is as follows:
00-08-20-83-53-D1
This MAC address is composed of 12-digit hexadecimal number which are grouped into 6
groups. Each group is known as an octet. Therefore, a MAC address is composed of 6 octets.
Note that, in hexadecimal also known as base 16, you can only accepf 0..9 and A..F. Therefore,
the following is not a valid MAC address:
GO-08-20-83-53-D1
→ G is not a valid hexadecimal digit.
Similarly, Note that the MAC address is invalid if the number of octets is less than 6.
Each of the octets in a MAC address have a particular meaning. These are illustrated in the
following figure.
-6 octets-
1st octet
2nd octet
3rd octet
4th octet
5th octet
6th octet
or
octets
3 octets-
Organisationally Unique
Identifier (OUI)
Network Interface Controller
(NIC) Specific
-8 bits
b7 b6 b5 b4 b3 b2 b1 b0
0: unicast
1: multicast
0: globally unique (OUI enforced)
1: locally administered
Your programming task is to write a C program that will first check if the entered MAC address
is valid and then will do the following analysis of the given MAC address:
a) Unicast or Multicast: A MAC address can be unicast or multicast. This is specified in the first
octet in the MAC address. When the first octet is converted to binary, if the right most digit is o
then the MAC address is unicast. If it is 1 then it is multicast. For example, given the following
MAC address:
00-08-20-83-53-D1
First octet is 00 which is converted to binary as 00000000 and since the last digit is zero then this
MAC address is unicast.
Another example, given the following MAC address:
01-08-20-83-53-D1
First octet is 01 which is converted to binary as 00000001 and since the last digit is one then this
MAC address is multicast.
b) Global or Local: Addresses can either be globally or locally administered. A globally
administered address is uniquely assigned to a device by its manufacturer. A locally
administered address is assigned to a device by software or a network administrator, overriding
the burned-in address for physical devices. This is specified in the first octet of the address. If
the digit before the last digit is zero then it is global, if it is one then it is local. For example, given
the following MAC address:
00-08-20-83-53-D1
First octet is 00 which is converted to binary as 00000000 and since the digit before the last digit
is zero then this MAC address is global.
Another example, given the following MAC address:
02-08-20-83-53-D1
First octet is 02 which is converted to binary as 00000010 and since the digit before the last digit
is one then this MAC address is local.
c) Organizational Unique Identifier: First 6-digits or first 3-octets (say 00-40-96) of MAC Address
identifies the manufacturer, called as OUI (Organizational Unique Identifier). In your program,
assume that we only know the following three. If another OUI is entered then your program
should report that, that OUI is unknown.
Organisation
Cisco
OUI
CC-46-D6 OR 00-08-20
ЗС-5А-В4
Google
Huawei
00-9A-CD
For example, given the following MAC address:
Transcribed Image Text:Programming Requirements: Media Access Control (MAC) Addresses are unique hardware number of a computer, which is embedded into network card during the time of manufacturing and also known as Physical Address of a network device. MAC Address is a 12-digit hexadecimal number, which is represented by Colon-Hexadecimal notation. An example valid MAC address is as follows: 00-08-20-83-53-D1 This MAC address is composed of 12-digit hexadecimal number which are grouped into 6 groups. Each group is known as an octet. Therefore, a MAC address is composed of 6 octets. Note that, in hexadecimal also known as base 16, you can only accepf 0..9 and A..F. Therefore, the following is not a valid MAC address: GO-08-20-83-53-D1 → G is not a valid hexadecimal digit. Similarly, Note that the MAC address is invalid if the number of octets is less than 6. Each of the octets in a MAC address have a particular meaning. These are illustrated in the following figure. -6 octets- 1st octet 2nd octet 3rd octet 4th octet 5th octet 6th octet or octets 3 octets- Organisationally Unique Identifier (OUI) Network Interface Controller (NIC) Specific -8 bits b7 b6 b5 b4 b3 b2 b1 b0 0: unicast 1: multicast 0: globally unique (OUI enforced) 1: locally administered Your programming task is to write a C program that will first check if the entered MAC address is valid and then will do the following analysis of the given MAC address: a) Unicast or Multicast: A MAC address can be unicast or multicast. This is specified in the first octet in the MAC address. When the first octet is converted to binary, if the right most digit is o then the MAC address is unicast. If it is 1 then it is multicast. For example, given the following MAC address: 00-08-20-83-53-D1 First octet is 00 which is converted to binary as 00000000 and since the last digit is zero then this MAC address is unicast. Another example, given the following MAC address: 01-08-20-83-53-D1 First octet is 01 which is converted to binary as 00000001 and since the last digit is one then this MAC address is multicast. b) Global or Local: Addresses can either be globally or locally administered. A globally administered address is uniquely assigned to a device by its manufacturer. A locally administered address is assigned to a device by software or a network administrator, overriding the burned-in address for physical devices. This is specified in the first octet of the address. If the digit before the last digit is zero then it is global, if it is one then it is local. For example, given the following MAC address: 00-08-20-83-53-D1 First octet is 00 which is converted to binary as 00000000 and since the digit before the last digit is zero then this MAC address is global. Another example, given the following MAC address: 02-08-20-83-53-D1 First octet is 02 which is converted to binary as 00000010 and since the digit before the last digit is one then this MAC address is local. c) Organizational Unique Identifier: First 6-digits or first 3-octets (say 00-40-96) of MAC Address identifies the manufacturer, called as OUI (Organizational Unique Identifier). In your program, assume that we only know the following three. If another OUI is entered then your program should report that, that OUI is unknown. Organisation Cisco OUI CC-46-D6 OR 00-08-20 ЗС-5А-В4 Google Huawei 00-9A-CD For example, given the following MAC address:
For example, given the following MAC address:
00-08-20-83-53-D1
Since the first three octets are 00-08-20, then we can say that the manufacturer is Cisco.
Another example is as follows:
00-9A-CD-83-53-D1
Since the first three octets are 00-9A-CD then we can say that the manufacturer is Huawei.
Sample Run:
Welcome to MAC analyser!
Please enter a MAC address: 00-08-20-83-53
This is not a valid MAC address!
Please enter a MAC address: 00-08-20-83-53-DG
This is not a valid MAC address!
Please enter a MAC address: 00-08-20-83-53-D1
This is valid!
1. Is It Unicast or Multicast?
2. Is It Global or Local?
3. What is the Manufacturer Info?
4. Enter Another MAC address
5. Exit
What would you like to do? 1
Is It Unicast or Multicast?
Unicast: First bit = 0.
===== =============
1. Is It Unicast or Multicast?
2. Is It Global or Local?
3. What is the Manufacturer Info?
4. Enter Another MAC address
5. Exit
What would you like to do? 2
Is It Global or Local?
Global: Second bit = 0.
1. Is It Unicast or Multicast?
2. Is It Global or Local?
3. What is the Manufacturer Info?
4. Enter Another MAC address
5. Exit
What would you like to do? 3
What is the Manufacturer Info?
Manufacturer Info: Cisco
1. Is It Unicast or Multicast?
2. Is It Global or Local?
3. What is the Manufacturer Info?
4. Enter Another MAC address
5. Exit
What would you like to do:4
Please enter a MAC address: 11-08-20-83-53-11
Valid MAC Address!
1. Is It Unicast or Multicast?
2. Is It Global or Local?
3. What is the Manufacturer Info?
4. Enter Another MAC address
5. Exit
What would you like to do:3
What is the Manufacturer Info?
Manufacturer Info: Unknown
===== ===
1. Is It Unicast or Multicast?
2. Is It Global or Local?
3. What is the Manufacturer Info?
4. Enter Another MAC address
5. Exit
Transcribed Image Text:For example, given the following MAC address: 00-08-20-83-53-D1 Since the first three octets are 00-08-20, then we can say that the manufacturer is Cisco. Another example is as follows: 00-9A-CD-83-53-D1 Since the first three octets are 00-9A-CD then we can say that the manufacturer is Huawei. Sample Run: Welcome to MAC analyser! Please enter a MAC address: 00-08-20-83-53 This is not a valid MAC address! Please enter a MAC address: 00-08-20-83-53-DG This is not a valid MAC address! Please enter a MAC address: 00-08-20-83-53-D1 This is valid! 1. Is It Unicast or Multicast? 2. Is It Global or Local? 3. What is the Manufacturer Info? 4. Enter Another MAC address 5. Exit What would you like to do? 1 Is It Unicast or Multicast? Unicast: First bit = 0. ===== ============= 1. Is It Unicast or Multicast? 2. Is It Global or Local? 3. What is the Manufacturer Info? 4. Enter Another MAC address 5. Exit What would you like to do? 2 Is It Global or Local? Global: Second bit = 0. 1. Is It Unicast or Multicast? 2. Is It Global or Local? 3. What is the Manufacturer Info? 4. Enter Another MAC address 5. Exit What would you like to do? 3 What is the Manufacturer Info? Manufacturer Info: Cisco 1. Is It Unicast or Multicast? 2. Is It Global or Local? 3. What is the Manufacturer Info? 4. Enter Another MAC address 5. Exit What would you like to do:4 Please enter a MAC address: 11-08-20-83-53-11 Valid MAC Address! 1. Is It Unicast or Multicast? 2. Is It Global or Local? 3. What is the Manufacturer Info? 4. Enter Another MAC address 5. Exit What would you like to do:3 What is the Manufacturer Info? Manufacturer Info: Unknown ===== === 1. Is It Unicast or Multicast? 2. Is It Global or Local? 3. What is the Manufacturer Info? 4. Enter Another MAC address 5. Exit
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY