
- Data Comm & Networks Home
- DCN - Overview
- DCN - What is Computer Network
- DCN - Uses of Computer Network
- DCN - Computer Network Types
- DCN - Network LAN Technologies
- DCN - Computer Network Models
- DCN - Computer Network Security
- DCN - Components
- DCN - Connectors
- DCN - Switches
- DCN - Repeaters
- DCN - Gateways
- DCN - Bridges
- DCN - Socket
- DCN - Network Interface Card
- DCN - NIC: Pros and Cons
- DCN - Network Hardware
- DCN - Network Port
- Computer Network Topologies
- DCN - Computer Network Topologies
- DCN - Point-to-point Topology
- DCN - Bus Topology
- DCN - Star Topology
- DCN - Ring Topology
- DCN - Mesh Topology
- DCN - Tree Topology
- DCN - Hybrid Topology
- Physical Layer
- DCN - Physical Layer Introduction
- DCN - Digital Transmission
- DCN - Analog Transmission
- DCN - Transmission media
- DCN - Wireless Transmission
- DCN - Transmission Impairments
- DCN - Multiplexing
- DCN - Network Switching
- Data Link Layer
- DCN - Data Link Layer Introduction
- DCN - Data Link Control & Protocols
- DCN - RMON
- DCN - Token Ring Network
- DCN - Hamming Code
- DCN - Byte Stuffing
- DCN - Channel Allocation
- DCN - MAC Address
- DCN - Cyclic Redundancy Checks
- DCN - Error Control
- DCN - Flow Control
- DCN - Framing
- DCN - Error Detection & Correction
- DCN - Error Correcting Codes
- DCN - Parity Bits
- Network Layer
- DCN - Network Layer Introduction
- DCN - Network Addressing
- DCN - Routing
- DCN - Internetworking
- DCN - Network Layer Protocols
- DCN - Routing Information Protocol
- DCN - Border Gateway Protocol
- DCN - OSPF Protocol
- DCN - Network Address Translation
- DCN - Network Address Translation Types
- Transport Layer
- DCN - Transport Layer Introduction
- DCN - Transmission Control Protocol
- DCN - User Datagram Protocol
- DCN - Congestion Control
- DCN - TCP Service Model
- DCN - TLS Handshake
- DCN - TCP Vs. UDP
- Application Layer
- DCN - Application Layer Introduction
- DCN - Client-Server Model
- DCN - Application Protocols
- DCN - Network Services
- DCN - Virtual Private Network
- DCN - Load Shedding
- DCN - Optimality Principle
- DCN - Service Primitives
- DCN - Services of Network Security
- DCN - Hypertext Transfer Protocol
- DCN - File Transfer Protocol
- DCN - Secure Socket Layer
- Network Protocols
- DCN - ALOHA Protocol
- DCN - Pure ALOHA Protocol
- DCN - Sliding Window Protocol
- DCN - Stop and Wait Protocol
- DCN - Link State Routing
- DCN - Link State Routing Protocol
- Network Algorithms
- DCN - Shortest Path Algorithm
- DCN - Routing Algorithm
- DCN - Leaky Bucket Algorithm
- Wireless Networks
- DCN - Wireless Networks
- DCN - Wireless LANs
- DCN - Wireless LAN & IEEE 802.11
- DCN - IEEE 802.11 Wireless LAN Standards
- DCN - IEEE 802.11 Networks
- Multiplexing
- DCN - Multiplexing & Its Types
- DCN - Time Division Multiplexing
- DCN - Synchronous TDM
- DCN - Asynchronous TDM
- DCN - Synchronous Vs. Asynchronous TDM
- DCN - Frequency Division Multiplexing
- DCN - TDM Vs. FDM
- DCN - Code Division Multiplexing
- DCN - Wavelength Division Multiplexing
- Miscellaneous
- DCN - Shortest Path Routing
- DCN - B-ISDN Reference Model
- DCN - Design Issues For Layers
- DCN - Selective-repeat ARQ
- DCN - Flooding
- DCN - E-Mail Format
- DCN - Cryptography
- DCN - Unicast, Broadcast, & Multicast
- DCN - Network Virtualization
- DCN - Flow Vs. Congestion Control
- DCN - Asynchronous Transfer Mode
- DCN - ATM Networks
- DCN - Synchronous Vs. Asynchronous Transmission
- DCN - Network Attacks
- DCN - WiMax
- DCN - Buffering
- DCN - Authentication
- DCN Useful Resources
- DCN - Quick Guide
- DCN - Useful Resources
Hamming Code in Computer Networks
In Computer Networks, Hamming code is used for the set of error-correction codes which may occur when the data is moved from the sender to the receiver. The hamming method corrects the error by finding the state at which the error has occurred.
Redundant Bits
Redundant bits are extra binary bits that are generated and added to the information-carrying bits of data transfer to ensure that no bits were lost during the data transfer. The redundancy bits are placed at certain calculated positions to eliminate the errors and the distance between the two redundancy bits is called "Hamming Distance".
Error Correction Code This is the relationship between data bits and redundancy bits to correct a single-bit error. A-frame consists of M data bits and R redundant bits. Suppose the total length of the frame be N (N=M+R). An N-bit unit containing data and the check bit is often referred to as an N-bit codeword.
The following formula is used to find the number of redundant bits.
Number of single-bit errors = M + R
Number of states for no error = 1
So, the number of redundant bits (R) that represent all states (M+R+1) must satisfy
2 + + 1
where R = Redundant bit, and M = data bit.
Steps to Find Hamming Code
The hamming method uses the extra parity bits to allow the identification of a single-bit error.
- Step 1 First write the bit positions starting from 1 in a binary form (1, 10, 11,100, etc.)
- Step 2 Mark all the bit positions that are powers of two as parity bits (1, 2, 4, 8, 16, 32, 64, etc.)
- Step 3 All other bit positions are for the data to be encoded using (3, 5, 6, 7, 9, 10 and 11, etc.)
Each parity bit calculates the parity for some of the bits in the code word. The position of the parity determines the sequence of bits that it alternatively checks and skips.
- Position 1 Check 1 bit, then skip 1 bit, check 1 bit and then skip 1 bit and so on (Ex 1,3,5,7,11, etc.)
- Position 2 Check 2 bit, then skip 2 bit, check 2 bit, then skip 2 bit (Ex 2,3,6,7,10,11,14,15, etc.)
- Position 4 Check 4 bit, then skip 4 bit, check 4 bit, then skip 4 bit (Ex 4, 5, 6, 7, 12, 13, 14, 15, etc.)
- Position 8 Check 8 bit, then skip 8 bit, check 8 bit, then skip 8 bit (Ex 8, 9, 10, 11, 12, 13, 14, 15, 24, 25, 26, 27, 28, 29, 30, 31).
Note Set the parity bit 1 if the total number of 1s in the positions it checks odd or set the parity bit 0 if the total number of 1s in the positions it checks even.
Example
Construct the even parity Hamming code word for a data byte 1001101.
The number (1001101) of bits is 7.
The value of r is calculated as
2 + + 1
24 7 + 4 + 1
Therefore, the number of redundancy bits = 4
Now, let's calculate the required number of parity bits.
We take = 2, then 2 = 22 = 4 and + + 1 = 4 + 2 + 1 = 7
The 2 parity bits are not sufficient for the 4-bit data.
Now, we will take = 3,then 2 = 23 = 8 and + + 1 = 4 + 3 + 1 = 8
Therefore, 3 parity bits are sufficient for 4-bit data.
The total bits in the codeword are 4 + 3 = 7
Position 1: checks the bits 1,3,5,7,9 and 11.
? _1_0 0 1_1 0 1 0.In position 1 even parity so set position 1 to a 0:0_1_0 0 1_1 0 1 0.
0 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 0 |
Position 2: checks bits 2,3,6,7,10,11.
0 ? 1_0 0 1_1 0 1 0. In position 2 odd parity so set position 2 to.a 1:0 1 1_0 0 1_1 0 1 0
0 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 |
Position 4 checks bits 4,5,6,7,12.
0 1 1 ? 0 0 1_1 0 1 0. In position 4 odd parity so set position 4 to.a 1: 0 1 1 1 0 0 1_1 0 1 0
0 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 0 |
Position 8 checks bits 8,9,10,11,12.
0 1 1 1 0 0 1 ? 1 0 1 0. In position 8 even parity so set position 8 to.a 1: 0 1 1 1 0 0 1 0 1 0 1 0
0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 |
Code Word = 011100101010
0 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 |