# Chapter 7

Ethernet 2.0 and IEEE 802.3 compatible and can communicate with each other, they use CSMA/CD

Ethernet 2 (also known as “Ethernet ii”, “Ethernet Version 2” or “Ethernet 802.3”) is a standard protocol used across all the parts of networking equipment, regardless of the manufacture. It was developed by IEEE.

### **802.2 vs 802.3**&#x20;

802.3 and 802.2 do not refer directly to physical architectures, but to the format of the layer 2 Ethernet frame.

* 802.2 is the default frame type for Netware 3.12 and 4.x, 802.3 is used for Netware 3.11 and earlier.
* 802.3 is a bit like Novell 802.3 raw + 802.2 LLC, created by IEEE for its own Ethernet specification. Hence, it came to be known as Ethernet 2.&#x20;

### **What are the Frame Formats From the IEEE?**&#x20;

There are three frame formats from the IEEE: IEEE 802.3, IEEE 802.3 with SNAP, and 802.3 with 802.2. Modern operating systems can send and receive any of these frame formats.&#x20;

### **Why is Ethernet 2 More Popular Among Managers?**&#x20;

To run TCP/IP over IEEE 802.3, the SNAP format has to be used. That requires 8 bytes of the data field to identify the kind of data the frame is carrying: three bytes for the Logical Link Control, three bytes for the SNAP header, and two bytes for the Protocol Type field. That means the data field shrinks from the standard range of 46 to 1500 bytes down to a range of 38 to 1492. This is the reason most network managers stay with Ethernet II.

### **Ethernet Protocol Types**&#x20;

The Ether Type field contains two bytes of hexadecimal code. This table translates the codes to some of the more commonly used codes:

| Ether Type | Protocol                                   |
| ---------- | ------------------------------------------ |
| 0x0800     | Internet Protocol, Version 4 (IPv4)        |
| 0x0806     | Address Resolution Protocol (ARP)          |
| 0x8035     | Reverse Address Resolution Protocol (RARP) |
| 0x8100     | VLAN-tagged frame (IEEE 802.1Q)            |
| 0x814C     | Simple Network Management Protocol (SNMP)  |
| 0x86DD     | Internet Protocol, Version 6 (IPv6)        |
| 0x8847     | MPLS unicast                               |
| 0x8848     | MPLS multicast                             |
| 0x8870     | Jumbo Frames                               |
| 0x888E     | EAP over LAN (IEEE 802.1X)                 |
| 0x88E5     | MAC security (IEEE 802.1AE)                |
| 0x88F7     | Precision Time Protocol (IEEE 1588)        |

**Carrier-sense multiple access with collision detection** (**CSMA/CD**) is a [media access control](https://en.wikipedia.org/wiki/Media_access_control) (MAC) method used most notably in early [Ethernet](https://en.wikipedia.org/wiki/Ethernet) technology for [local area networking](https://en.wikipedia.org/wiki/Local_area_network). It uses [carrier](https://en.wikipedia.org/wiki/Carrier_signal)-sensing to defer transmissions until no other stations are transmitting. This is used in combination with collision detection in which a transmitting station detects collisions by sensing transmissions from other stations while it is transmitting a [frame](https://en.wikipedia.org/wiki/Frame_\(telecommunications\)). When this collision condition is detected, the station stops transmitting that frame, transmits a jam signal, and then waits for a random time interval before trying to resend the frame.

CSMA/CD is a modification of pure [carrier-sense multiple access](https://en.wikipedia.org/wiki/Carrier-sense_multiple_access) (CSMA). CSMA/CD is used to improve CSMA performance by terminating transmission as soon as a collision is detected, thus shortening the time required before a retry can be attempted.

With the growing popularity of [Ethernet switches](https://en.wikipedia.org/wiki/Ethernet_switch) in the 1990s, [IEEE 802.3](https://en.wikipedia.org/wiki/IEEE_802.3) deprecated [Ethernet repeaters](https://en.wikipedia.org/wiki/Ethernet_repeater) in 2011,making CSMA/CD and half-duplex operation less common and less important.

## Jamming-signal meaning

Filters A signal that intentionally introduces interference into a communication channel, either to intentionally prevent error-free reception or as a means of advising stations of some event.21In local area networks (LANs), employing the carrier sense multiple access with collision detection (CSMA/CD) protocol, a station that detects a signal collision sends a jamming signal over a subcarrier frequency to advise all stations of that fact.

&#x20;**Exponential backoff** is an [algorithm](https://en.wikipedia.org/wiki/Algorithm) that uses [feedback](https://en.wikipedia.org/wiki/Feedback) to multiplicatively decrease the rate of some process, in order to gradually find an acceptable rate.

In a variety of [computer networks](https://en.wikipedia.org/wiki/Computer_networks), **binary exponential backoff** or **truncated binary exponential backoff** refers to an [algorithm](https://en.wikipedia.org/wiki/Algorithm) used to space out repeated [retransmissions](https://en.wikipedia.org/wiki/Retransmission_\(data_networks\)) of the same block of [data](https://en.wikipedia.org/wiki/Data), often to [avoid network congestion](https://en.wikipedia.org/wiki/Network_congestion_avoidance).

Examples are the retransmission of [frames](https://en.wikipedia.org/wiki/Data_frame) in [carrier sense multiple access with collision avoidance](https://en.wikipedia.org/wiki/Carrier_sense_multiple_access_with_collision_avoidance) (CSMA/CA) and [carrier sense multiple access with collision detection](https://en.wikipedia.org/wiki/Carrier_sense_multiple_access_with_collision_detection) (CSMA/CD) networks, where this algorithm is part of the [channel access](https://en.wikipedia.org/wiki/Media_access_control) method used to send data on these networks. In [Ethernet](https://en.wikipedia.org/wiki/Ethernet) networks, the algorithm is commonly used to schedule retransmissions after collisions. The retransmission is delayed by an amount of [time](https://en.wikipedia.org/wiki/Time) derived from the [slot time](https://en.wikipedia.org/wiki/Slot_time) (for example, the time it takes to send 512 bits; i.e., 512 [bit-times](https://en.wikipedia.org/wiki/Bit_time)) and the number of attempts to retransmit.

After c collisions, a random number of slot times between 0 and 2c − 1 is chosen. After the first collision, each sender will wait 0 or 1 slot times. After the second collision, the senders will wait anywhere from 0 to 3 slot times ([inclusive](https://en.wikipedia.org/wiki/Interval_\(mathematics\))). After the third collision, the senders will wait anywhere from 0 to 7 slot times (inclusive), and so forth. As the number of retransmission attempts increases, the number of possibilities for delay [increases exponentially](https://en.wikipedia.org/wiki/Exponential_growth).

The 'truncated' simply means that after a certain number of increases, the exponentiation stops; i.e. the retransmission timeout reaches a ceiling, and thereafter does not increase any further. For example, if the ceiling is set at i = 10 (as it is in the [IEEE 802.3](https://en.wikipedia.org/wiki/IEEE_802.3) CSMA/CD standard), then the maximum delay is 1023 slot times. This is useful because these delays cause other stations that are sending to collide as well. There is a possibility that, on a busy network, hundreds of people may be caught in a single collision set.



### Example exponential backoff algorithm

This example is from the [Ethernet](https://en.wikipedia.org/wiki/Ethernet) protocol, where a sending host is able to know when a collision has occurred (that is, another host has tried to transmit), when it is sending a frame. If both hosts attempted to re-transmit as soon as a collision occurred, there would be yet another collision — and the pattern would continue forever. The hosts must choose a random value within an acceptable range to ensure that this situation doesn't happen. An exponential backoff algorithm is therefore used. The value '51.2 μs' is used as an example here because it is the slot time for a 10 Mbit/s Ethernet line. However, 51.2 μs could be replaced by any positive value, in practice.

1. When a collision first occurs, send a "Jamming signal" to prevent further data from being sent.
2. Resend a frame after either 0 seconds or 51.2 μs, chosen at random.
3. If that fails, resend the frame after either 0 s, 51.2 μs, 102.4 μs, or 153.6 μs.
4. If that still doesn't work, resend the frame after k · 51.2 μs, where k is a random integer between 0 and 23 − 1.
5. In general, after the _c_ th failed attempt, resend the frame after k · 51.2 μs, where k is a random integer between 0 and 2c − 1.

switch (full-duplex) used in CSMA / CD

the use of CSMA/CD is a system that sees traffic lights in the crossing of goods, in the process of seeing whether there are goods passing is called carrier sense. after that they will start sending goods and while hearing if there are goods that are passing, and if there is a collision then the goods will not be sent and there will be something we call a jamming signal after jamming signal they will run to BEB.

{% file src="https://2277444168-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mc7aa7TpYiFT5jdyFYT%2F-Mcj1n0r2KDXX4EZKiwx%2F-Mcj2jsGFdCJJTWrvYDK%2Fphoto_2021-06-21_22-51-07.jpg?alt=media&token=d55ae87a-2a9b-4e44-a5f0-aeef39810251" %}

**Carrier-sense multiple access with collision avoidance** (**CSMA/CA**) in [computer networking](https://en.wikipedia.org/wiki/Computer_network), is a network [multiple access method](https://en.wikipedia.org/wiki/Multiple_access_method) in which [carrier](https://en.wikipedia.org/wiki/Carrier_signal) sensing is used, but [nodes](https://en.wikipedia.org/wiki/Node_\(networking\)) attempt to avoid collisions by beginning transmission only after the channel is sensed to be "idle". When they do transmit, nodes transmit their packet data in its entirety.

It is particularly important for wireless networks, where the collision detection of the alternative [CSMA/CD](https://en.wikipedia.org/wiki/Carrier-sense_multiple_access_with_collision_detection) is not possible due to wireless transmitters desensing their receivers during packet transmission.

CSMA/CA is unreliable due to the [hidden node problem](https://en.wikipedia.org/wiki/Hidden_node_problem).

CSMA/CA is a protocol that operates in the [Data Link Layer](https://en.wikipedia.org/wiki/Data_Link_Layer) (Layer 2) of the [OSI model](https://en.wikipedia.org/wiki/OSI_model).

Collision avoidance is used to improve the performance of the [CSMA](https://en.wikipedia.org/wiki/Carrier_sense_multiple_access) method by attempting to divide the channel somewhat equally among all transmitting nodes within the collision domain.

1. **Carrier Sense**: prior to transmitting, a node first listens to the shared medium (such as listening for wireless signals in a wireless network) to determine whether another node is transmitting or not. Note that the [hidden node problem](https://en.wikipedia.org/wiki/Hidden_node_problem) means another node may be transmitting which goes undetected at this stage.
2. **Collision Avoidance**: if another node was heard, we wait for a period of time (usually random) for the node to stop transmitting before listening again for a free communications channel.

* **Request to Send/Clear to Send** (RTS/CTS) may optionally be used at this point to mediate access to the shared medium. This goes some way to alleviating the problem of hidden nodes because, for instance, in a wireless network, the Access Point only issues a Clear to Send to one node at a time. However, wireless [802.11](https://en.wikipedia.org/wiki/802.11) implementations do not typically implement RTS/CTS for all transmissions; they may turn it off completely, or at least not use it for small packets (the overhead of RTS, CTS and transmission is too great for small data transfers).
* **Transmission**: if the medium was identified as being clear or the node received a CTS to explicitly indicate it can send, it sends the frame in its entirety. Unlike [CSMA/CD](https://en.wikipedia.org/wiki/CSMA/CD), it is very challenging for a wireless node to listen at the same time as it transmits (its transmission will dwarf any attempt to listen). Continuing the wireless example, the node awaits receipt of an acknowledgement packet from the Access Point to indicate the packet was received and checksummed correctly. If such acknowledgement does not arrive in a timely manner, it assumes the packet collided with some other transmission, causing the node to enter a period of [binary exponential backoff](https://en.wikipedia.org/wiki/Binary_exponential_backoff) prior to attempting to re-transmit.

Although CSMA/CA has been used in a variety of wired communication systems, it is particularly beneficial in a [wireless LAN](https://en.wikipedia.org/wiki/Wireless_LAN) due to a common problem of multiple stations being able to see the Access Point, but not each other. This is due to differences in transmit power, and receive sensitivity, as well as distance, and location with respect to the AP. This will cause a station to not be able to 'hear' another station's broadcast. This is the so-called '[hidden node](https://en.wikipedia.org/wiki/Hidden_node)', or 'hidden station' problem. Devices utilizing [802.11](https://en.wikipedia.org/wiki/802.11) based standards can enjoy the benefits of collision avoidance (RTS / CTS handshake, also [Point coordination function](https://en.wikipedia.org/wiki/Point_coordination_function)), although they do not do so by default. By default they use a Carrier sensing mechanism called 'exponential backoff', or ([Distributed coordination function](https://en.wikipedia.org/wiki/Distributed_coordination_function)) that relies upon a station attempting to 'listen' for another station's broadcast before sending. CA, or PCF relies upon the AP (or the 'receiver' for Ad hoc networks) granting a station the exclusive right to transmit for a given period of time after requesting it (Request to Send / Clear to Send).

CSMA-CA requires a determination of whether a channel is 'idle', even when incompatible standards and overlapping transmission frequencies are used. Per the standards, for 802.11/Wi-Fi transmitters on the same channel, transmitters must take turns to transmit if they can detect each other even 3 dB above the [noise floor](https://en.wikipedia.org/wiki/Noise_floor) (the thermal noise floor is around -101 dBm for 20 MHz channels). On the other hand, transmitters will ignore transmitters with incompatible standards or on overlapping channels if the received signal strength from them is below a threshold Pth which, for non [Wi-Fi 6](https://en.wikipedia.org/wiki/Wi-Fi_6) systems, is between -76 and -80 dBm.

It used wired (ethernet ) to BEB after collision

It used  wireless ( wifi ) to BEB before transmission

{% file src="https://2277444168-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mc7aa7TpYiFT5jdyFYT%2F-Mcj1n0r2KDXX4EZKiwx%2F-Mcj2nywpEfx7VylmdGq%2Fphoto_2021-06-21_22-51-11.jpg?alt=media&token=fbdf19df-1a16-4f68-aa30-a18022f20d06" %}

Before starting it is better to get acquainted with a term called **Protocol Data Unit (PDU)**.\
The term PDU is used to refer to the packets in different layers of the OSI model. Thus PDU gives an abstract idea of the data packets. The PDU has a different meaning in different layers still we can use it as a common term.

To give a clear picture:-

1. The PDU of Transport Layer is called as a Segment.
2. The PDU of Network Layer is called as a Packet.
3. The PDU of the Data-Link Layer is called Frames.

This is the basic meaning of different terms used in Computer Networks.

The [Application layer](https://www.geeksforgeeks.org/protocols-application-layer/) can give any amount of data to the underlying layers, but it is not possible to send all the data given by the application layer to send directly. Thus, the TCP comes into the picture. The TCP helps break the data(given by application layer) into MSS(Maximum Segment Size) that the given network can handle so that further fragmentation doesn’t occur in the routers.

&#x20;A **frame check sequence** (**FCS**) is an [error-detecting code](https://en.wikipedia.org/wiki/Error-detecting_code) added to a [frame](https://en.wikipedia.org/wiki/Frame_\(networking\)) in a [communication protocol](https://en.wikipedia.org/wiki/Communication_protocol). Frames are used to send [payload data](https://en.wikipedia.org/wiki/Payload_data) from a source to a destination.

Preamble is used to adjust the clock rate at the receiver side.



In [wireless networking](https://en.wikipedia.org/wiki/Wireless_networking), the **hidden node problem** or **hidden terminal problem** occurs when a [node](https://en.wikipedia.org/wiki/Node_\(networking\)) can communicate with a [wireless access point](https://en.wikipedia.org/wiki/Wireless_access_point) (AP), but cannot directly communicate with other nodes that are communicating with that AP. This leads to difficulties in [medium access control](https://en.wikipedia.org/wiki/Medium_access_control) sublayer since multiple nodes can send data packets to the AP simultaneously, which creates interference at the AP resulting in no packet getting through.

Although some loss of packets is normal in wireless networking, and the higher layers will resend them, if one of the nodes is transferring a lot of large packets over a long period, the other node may get very little [goodput](https://en.wikipedia.org/wiki/Goodput).

Practical protocol solutions exist to the hidden node problem. For example, Request To Send/Clear To Send (RTS/CTS) mechanisms where nodes send short packets to request permission of the access point to send longer data packets. Because responses from the AP are seen by all the nodes, the nodes can synchronize their transmissions to not interfere. However, the mechanism introduces latency, and the overhead can often be greater than the cost, particularly for short data packets.

In [wireless networks](https://en.wikipedia.org/wiki/Wireless_networks), the **exposed node problem** occurs when a node is prevented from sending packets to other nodes because of [co-channel interference](https://en.wikipedia.org/wiki/Co-channel_interference) with a neighboring transmitter. Consider an example of four nodes labeled R1, S1, S2, and R2, where the two receivers (R1, R2) are out of range of each other, yet the two transmitters (S1, S2) in the middle are in range of each other. Here, if a transmission between S1 and R1 is taking place, node S2 is prevented from transmitting to R2 as it concludes after [carrier sense](https://en.wikipedia.org/wiki/Carrier_sense) that it will interfere with the transmission by its neighbor S1. However note that R2 could still receive the transmission of S2 without interference because it is out of range of S1.

[IEEE 802.11 RTS/CTS](https://en.wikipedia.org/wiki/IEEE_802.11_RTS/CTS) mechanism helps to solve this problem only if the nodes are synchronized and packet sizes and data rates are the same for both the transmitting nodes. When a node hears an RTS from a neighboring node, but not the corresponding CTS, that node can deduce that it is an exposed node and is permitted to transmit to other neighboring nodes.

If the nodes are not synchronized (or if the packet sizes are different or the data rates are different) the problem may occur that the sender will not hear the CTS or the ACK during the transmission of data of the second sender.

The exposed node problem is not an issue in [cellular networks](https://en.wikipedia.org/wiki/Cellular_network) as the power and distance between cells is controlled to avoid it.

The information needed for a computer to gain access to a website for example google is: IP Address, Network Mask, Default Gateway (Router), and DNS.

The purpose of the network mask is to tell whether the nodes of the destination and source are on the same or different networks, and if they are different, it will involve a default gateway.



### Difference Between IPv4 and IPv6 Addresses

IPv4 & IPv6 are both [IP addresses](https://www.guru99.com/types-of-ip-addresses.html) that are binary numbers. Comparing IPv6 vs IPv4, IPv4 is 32 bit binary number while IPv6 is 128 bit binary number address. IPv4 address are separated by periods while IPv6 address are separated by colons.

Both are used to identify machines connected to a network. In principle, they are the same, but they are different in how they work. Below are the main differences between IPv4 and IPv6:

| **Basis for differences**          | **IPv4**                                                                                                                                                                          | **IPv6**                                                                                                         |
| ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| Size of IP address                 | IPv4 is a 32-Bit IP Address.                                                                                                                                                      | IPv6 is 128 Bit IP Address.                                                                                      |
| Addressing method                  | IPv4 is a numeric address, and its binary bits are separated by a dot (.)                                                                                                         | IPv6 is an alphanumeric address whose binary bits are separated by a colon (:). It also contains hexadecimal.    |
| Number of header fields            | 12                                                                                                                                                                                | 8                                                                                                                |
| Length of header filed             | 20                                                                                                                                                                                | 40                                                                                                               |
| Checksum                           | Has checksum fields                                                                                                                                                               | Does not have checksum fields                                                                                    |
| Example                            | 12.244.233.165                                                                                                                                                                    | 2001:0db8:0000:0000:0000:ff00:0042:7879                                                                          |
| Type of Addresses                  | Unicast, broadcast, and multicast.                                                                                                                                                | Unicast, multicast, and anycast.                                                                                 |
| Number of classes                  | IPv4 offers five different classes of IP Address. Class A to E.                                                                                                                   | lPv6 allows storing an unlimited number of IP Address.                                                           |
| Configuration                      | You have to configure a newly installed system before it can communicate with other systems.                                                                                      | In IPv6, the configuration is optional, depending upon on functions needed.                                      |
| VLSM support                       | IPv4 support VLSM (Variable Length Subnet mask).                                                                                                                                  | IPv6 does not offer support for VLSM.                                                                            |
| Fragmentation                      | Fragmentation is done by sending and forwarding routes.                                                                                                                           | Fragmentation is done by the sender.                                                                             |
| Routing Information Protocol (RIP) | RIP is a routing protocol supported by the routed daemon.                                                                                                                         | RIP does not support IPv6. It uses static routes.                                                                |
| Network Configuration              | Networks need to be configured either manually or with DHCP. IPv4 had several overlays to handle Internet growth, which require more maintenance efforts.                         | IPv6 support autoconfiguration capabilities.                                                                     |
| Best feature                       | Widespread use of NAT (Network address translation) devices which allows single NAT address can mask thousands of non-routable addresses, making end-to-end integrity achievable. | It allows direct addressing because of vast address Space.                                                       |
| Address Mask                       | Use for the designated network from host portion.                                                                                                                                 | Not used.                                                                                                        |
| SNMP                               | SNMP is a protocol used for system management.                                                                                                                                    | SNMP does not support IPv6.                                                                                      |
| Mobility & Interoperability        | Relatively constrained network topologies to which move restrict mobility and interoperability capabilities.                                                                      | IPv6 provides interoperability and mobility capabilities which are embedded in network devices.                  |
| Security                           | Security is dependent on applications - IPv4 was not designed with security in mind.                                                                                              | IPSec(Internet Protocol Security) is built into the IPv6 protocol, usable with a proper key infrastructure.      |
| Packet size                        | Packet size 576 bytes required, fragmentation optional                                                                                                                            | 1208 bytes required without fragmentation                                                                        |
| Packet fragmentation               | Allows from routers and sending host                                                                                                                                              | Sending hosts only                                                                                               |
| Packet header                      | Does not identify packet flow for QoS handling which includes checksum options.                                                                                                   | Packet head contains Flow Label field that specifies packet flow for QoS handling                                |
| DNS records                        | Address (A) records, maps hostnames                                                                                                                                               | Address (AAAA) records, maps hostnames                                                                           |
| Address configuration              | Manual or via DHCP                                                                                                                                                                | Stateless address autoconfiguration using Internet Control Message Protocol version 6 (ICMPv6) or DHCPv6         |
| IP to MAC resolution               | Broadcast ARP                                                                                                                                                                     | Multicast Neighbour Solicitation                                                                                 |
| Local subnet Group management      | Internet Group Management Protocol GMP)                                                                                                                                           | Multicast Listener Discovery (MLD)                                                                               |
| Optional Fields                    | Has Optional Fields                                                                                                                                                               | Does not have optional fields. But Extension headers are available.                                              |
| IPSec                              | Internet Protocol Security (IPSec) concerning network security is optional                                                                                                        | Internet Protocol Security (IPSec) Concerning network security is mandatory                                      |
| Dynamic host configuration Server  | Clients have approach DHCS (Dynamic Host Configuration server) whenever they want to connect to a network.                                                                        | A Client does not have to approach any such server as they are given permanent addresses.                        |
| Mapping                            | Uses ARP(Address Resolution Protocol) to map to MAC address                                                                                                                       | Uses NDP(Neighbour Discovery Protocol) to map to MAC address                                                     |
| Combability with mobile devices    | IPv4 address uses the dot-decimal notation. That's why it is not suitable for mobile networks.                                                                                    | IPv6 address is represented in hexadecimal, colon- separated notation. IPv6 is better suited to mobile networks. |

IPv4 and IPv6 cannot communicate with other but can exist together on the same network. This is known as **Dual Stack.**

What makes IPv4 not better than IPv6 :

1. IPv4 addresses are not enough&#x20;
2. &#x20;security issue.
3. &#x20;performance issue



**1. Hierarchical Routing Protocol :**\
Hierarchical Routing is the method of routing in [networks](https://www.geeksforgeeks.org/network-protocols/) that is based on hierarchical addressing. Most transmission control protocol, [Internet](https://www.geeksforgeeks.org/the-internet-and-the-web/) protocol (DCPIP). Routing is based on two level of hierarchical routing in which IP address is divided into a network, person and a host person. Gateways use only the network a person tell an IP data until gateways delivered it directly.

It addresses the growth of routing tables. Routers are further divided into regions and they know the route of their own regions only. It works like a telephone routing.

**Example –**\
City, State, Country, Continent.

**2. Flat Routing Protocol :**\
In flat routing protocol, if any node needs to transmit data, it first searches for a valid route to the base station and then transmits the data. Nodes to the base station may drain their energy quickly.

They are the flat networks in which every incoming packet is sent out on every outgoing line except the one it arrived on. Vast numbers of duplicate packets are generated. It is good for small networks and offers high reliability.

**Example –**\
Routing Information Protocol, Interior Gateway Routing Protocol.

\
\
**Difference between Hierarchical and Flat Routing Protocol :**

| Hierarchical Routing Protocol                         | Flat Routing Protocol                                            |
| ----------------------------------------------------- | ---------------------------------------------------------------- |
| It is simple but non-optimal routing.                 | Routing can be made optimal but with an added complexity.        |
| It is a Channel Reservation-based scheduling.         | It is a Contention-based scheduling.                             |
| Collisions is avoided.                                | Collisions over-head in attendance.                              |
| Overhead of cluster information all over the network. | Routes form only in the regions that have data for transmission. |
| Fair channel allocation.                              | Fairness is not guaranteed.                                      |
| In this, Energy Dissipation is consistent.            | In this, Energy Dissipation depends on traffic patterns.         |



{% file src="https://2277444168-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mc7aa7TpYiFT5jdyFYT%2F-Mci_6K_CCnaE9UPSpcK%2F-Mcj1QmUdP7lKA3gLqfB%2F1.jpg?alt=media&token=078a5c7b-990a-48bc-bf2e-59c90e43ef0b" %}

{% file src="https://2277444168-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mc7aa7TpYiFT5jdyFYT%2F-Mci_6K_CCnaE9UPSpcK%2F-Mcj1TfNwM8jafwd-9Ro%2F2.jpg?alt=media&token=7425dcba-8cf8-4df3-875d-e86dfe2705cb" %}

{% file src="https://2277444168-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mc7aa7TpYiFT5jdyFYT%2F-Mci_6K_CCnaE9UPSpcK%2F-Mcj1Vxx5tulcIUHEi4h%2F3.jpg?alt=media&token=126c2cf9-ee34-4851-9441-8fdcaf0c3ade" %}

{% file src="https://2277444168-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mc7aa7TpYiFT5jdyFYT%2F-Mci_6K_CCnaE9UPSpcK%2F-Mcj1Zw8jvIZGrdjNZgb%2F4.jpg?alt=media&token=cc7398a3-5409-469f-b673-f33ac79ce5e8" %}

{% file src="https://2277444168-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mc7aa7TpYiFT5jdyFYT%2F-Mci_6K_CCnaE9UPSpcK%2F-Mcj1b1NhvCvNdRQ5kaA%2F5.jpg?alt=media&token=4af4dd70-4604-449c-b700-535f73fd4ed8" %}

{% file src="https://2277444168-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mc7aa7TpYiFT5jdyFYT%2F-Mci_6K_CCnaE9UPSpcK%2F-Mcj1dgsLSrXu_0TnYgl%2F6.jpg?alt=media&token=dc85ca18-ee05-48f5-9c65-02dc3bfa6ef9" %}

{% file src="https://2277444168-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mc7aa7TpYiFT5jdyFYT%2F-Mci_6K_CCnaE9UPSpcK%2F-Mcj1gGwy3N3P2hBuzuW%2F7.jpg?alt=media&token=31810a5d-a0b4-428c-ab25-e11e894e68ac" %}

{% file src="https://2277444168-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mc7aa7TpYiFT5jdyFYT%2F-Mci_6K_CCnaE9UPSpcK%2F-Mcj1iIYud0ozKUtYof7%2F8.jpg?alt=media&token=664743da-588b-4eda-a807-2a416af662d4" %}

{% file src="https://2277444168-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mc7aa7TpYiFT5jdyFYT%2F-Mci_6K_CCnaE9UPSpcK%2F-Mcj1kZcj2uRYx8loqwb%2F9.jpg?alt=media&token=7e6fd414-2e45-48e8-b7be-ce4c0f5aef4e" %}



### What is Domain?

A domain is a type of computer network in which all user computers, printers accounts, and other devices registered. It is a central database located on single or multiple clusters of central computers, that is known as domain controllers.

### What is Collision Domain?

The collision domain defines the set of devices on which their frames could collide. It is a network segment connected by a shared medium or using repeaters where real-time data transmissions collide.

The collision domain applies to wireless networks. However, it also affects earlier versions of Ethernet. A collision happens when two separate devices simultaneously send a packet on the commonly shared network segment. The packets collide, and both devices require sending the packets again. That helps you to reduce network efficiency.

### What is Broadcast Domain?

A broadcast domain is a logical division of a computer network. In this type of Domain, nodes can reach each other using broadcast at the data link layer. A broadcast domain either in the same LAN segment or which can bridge to other LAN networks.

This Domain contains all devices which can reach each other at the data link layer with the help of broadcast. Every port on a switch or in a hub should be in the same broadcast domain.

However, all port on a router are in the distinct broadcast domains, and routers never broadcast from one Domain to another.

### Example of Collision domains

[![](https://www.guru99.com/images/2/100720_0908_CollisionDo1.png)](https://www.guru99.com/images/2/100720_0908_CollisionDo1.png)Collision Domain

Above given image is an example of a collision domain.

In the above example, you can see "Computer A" send a data signal to "Computer C." In the same way, "Computer B" sends a data signal to "Computer D" where a Collision will happen.

When the number of devices in a collision domain rises, and the chances of Collision will be increased. If there is more traffic in a collision domain, there are high chances of crashes to occur. More collisions will happen with many network devices in a Collision domain.

An increased number of collisions will result in a low-quality network because hosts spend a large amount of time for packet processing and retransmission.

In other words, Collision never happens between two devices, which are connected to different ports of a Switch.

### Example of Broadcast domains

[![](https://www.guru99.com/images/2/100720_0908_CollisionDo2.png)](https://www.guru99.com/images/2/100720_0908_CollisionDo2.png)Broadcast Domain

In the above-given image, you can see "Computer A" is sending a broadcast, and the switch will forward it to all the ports. Every connected switch will get a copy of the broadcast packet. Here, all the switches will flood the broadcast packet to all types of ports.

In this domain type, the router also gets a copy of the broadcast packet. However, the route will not forward the packet to the next network segment. When the number of broadcasts Domain increases, the number of broadcasts also increases, and the network quality comes down.

### Difference Between Collision and Broadcast Domain

Here are some important differences between Collision and Broadcast Domain:

[![](https://www.guru99.com/images/2/100720_0908_CollisionDo3.png)](https://www.guru99.com/images/2/100720_0908_CollisionDo3.png)

| **Collision Domain**                                                                        | **Broadcast Domain**                                                                            |
| ------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| The Collision domain is a network section that allows traffic to flow forward and backward. | A Broadcast domain is a type of Domain wherein traffic flows all over the network.              |
| The Collision domain refers to a set of devices in which packet collision could occur.      | Broadcast domain refers to a logical set of reachable computer systems without using a router.  |
| The devices might include the devices of other IP subnetworks.                              | Broadcast Domain is never limited to the specific IP subnetwork for all types of IP broadcasts. |
| Packet collision occurs as multiple devices transmit data on a single wire link.            | The broadcast domain mostly uses a switched environment to broadcast, so no collision occurs.   |
| Switches will break in the collision domain.                                                | Switches will never break in the broadcast domain.                                              |
| In, collision domain, every port on a router are in the separate broadcast domains.         | All ports on a switch or a hub likely to be in the same broadcast domain.                       |

### KEY DIFFERENCES:

* The Collision domain is a network section that allows traffic to flow forward and backward. In contrast, a Broadcast domain is a type of Domain wherein traffic flows all over the network.
* In the Collision domain, all the devices might include the devices of other IP subnetworks, whereas in the broadcast Domain is never limited to the specific IP subnetwork for all types of IP broadcasts.
* In collision domain, packet collision occurs as multiple devices transmit data on a single wire link. On the other hand, the broadcast domain mostly uses a switched environment to broadcast, so no collision occurs.
