UDP - User Datagram Protocol

What is UDP?

UDP stands for User Datagram Protocol. It’s a communication protocol used for fast, connectionless data transmission between devices on a network. Unlike TCP, UDP does not guarantee delivery, order, or error checking — it simply sends packets and doesn’t wait for acknowledgments.

Why is UDP useful?

UDP is useful when speed is more important than reliability. It’s ideal for applications where: * Occasional data loss is acceptable. * Real-time performance is critical. * Overhead from connection setup and error correction is undesirable.

How it works?

  • No connection setup – The sender just starts sending packets to the receiver.

  • Packets are sent – Each packet (called a datagram) is sent independently.

  • No acknowledgments – The sender doesn’t wait to see if the packet was received.

  • Receiver processes data – The receiver handles whatever packets it gets, in whatever order they arrive.

Where is UDP used?

  • Video streaming – Like live broadcasts where speed matters more than perfect quality.

  • Online gaming – Fast-paced games use UDP to reduce lag.

  • Voice over IP (VoIP) – Real-time voice communication prefers speed over reliability.

  • DNS lookups – DNS queries are small and fast, making UDP ideal.

Why OSI Layer: Transport Layer (Layer 4)?

  • It handles end-to-end communication between devices.

  • It provides port numbers to distinguish different services on the same device.

  • It enables multiplexing of data streams, even though it doesn’t manage reliability or ordering like TCP.

What are the key features?

  • Connectionless Protocol.

  • Unreliable Delivery.

  • No Ordering.

How does a server know where to reply in UDP?

Each incoming UDP datagram includes: * Source IP address. * Source port number. The server uses these to send a reply.

What is a datagram?

A datagram is a self-contained packet sent via UDP that includes both header and data. Each datagram is independent.

Why is UDP used if it’s unreliable?

Because it’s: * Fast and low-latency. * Requires less overhead. * Suitable for real-time or loss-tolerant applications.

What are some applications that use UDP?

  • DNS (Domain Name System).

  • VoIP (Voice over IP).

  • Video Streaming.

  • Online Gaming.

  • TFTP (Trivial File Transfer Protocol).

  • DHCP (Dynamic Host Configuration Protocol).

  • SNMP (Simple Network Management Protocol).

  • NTP (Network Time Protocol).

What is the working flow of UDP?

No Connection Needed: * UDP is connectionless — no handshake before sending data. * Sender just sends data directly. Data is Packed into Datagrams: * Each piece of data is packed into a UDP datagram. * Datagrams are independent (no sequence tracking). Datagram is Sent to Destination: * The sender sends the datagram to the receiver’s IP and port. * No guarantee of delivery. No Acknowledgment: * Receiver may or may not respond. * UDP does not expect or send ACKs. No Order or Reliability: * Packets may arrive out of order, or not at all. * It’s up to the application to handle errors, duplicates, or missing data. Receiver Gets Datagram: * If the datagram arrives, the receiver processes it immediately. * If it’s lost, UDP does nothing.

Is UDP suitable for real-time applications?

Yes — UDP is ideal where speed matters more than reliability, like: * Online gaming. * Video conferencing. * Voice calls.

  • In this section, you are going to learn

  • Terminology

  • Version Info

S.No

UDP Version

RFC

Year

Core Ideas/Contribution

1

UDP (Original)

RFC 768

1980

Introduced UDP as a simple,

connectionless transport layer protocol; provides minimal services like checksums and port numbers.

2

UDP-Lite

RFC 3828

2004

A variant of UDP that allows partial checksum

coverage, useful for multimedia applications

where some data loss is tolerable.

3

UDP with ECN

RFC 6040

2010

Describes how to use Explicit Congestion

Notification (ECN) with UDP to improve

congestion control.

4

UDP Guidelines

RFC 8085

2017

Provides guidelines for applications using UDP,

including congestion control, reliability, and security considerations.

5

UDP Options

RFC 7510

2015

Defines UDP encapsulation for IPsec VPNs,

allowing NAT traversal.

6

UDP Options Framework

RFC 9298

2022

Introduces a framework for extending UDP with

options, enabling new features while maintaining backward compatibility.

  • setup

  • setup

UDP UDP Packet

S.No

Protocol Packets

Description

Size(bytes)

1

UDP

65535

UDP Header

8 Bytes total

8

Source Port

Identifies the port number of the sender.

2

Destination Port

Identifies the port number of the receiver.

2

Length

Specifies the total length of the UDP packet,including the header and data.

2

Checksum

error-checking the header and data.

2

Data(UDP Payload)

Contains the actual payload being transmitted.

variable(65507)

S.No

Use Case

Descrption

1

DNS (Domain Name System)

UDP is used for fast, lightweight queries and responses between clients and DNS servers.

2

VoIP (Voice over IP)

UDP supports real-time voice communication with low latency, tolerating some packet loss.

3

Video Streaming

Used in live streaming where speed is prioritized over reliability (e.g., RTP over UDP).

4

Online Gaming

Enables fast transmission of game state updates with minimal delay.

5

DHCP (Dynamic Host Configuration Protocol)

Uses UDP to assign IP addresses quickly and efficiently.

6

TFTP (Trivial File Transfer Protocol)

A simple file transfer protocol using UDP for minimal overhead.

7

SNMP (Simple Network Management Protocol)

Uses UDP for lightweight network device monitoring and management.

8

NTP (Network Time Protocol)

Synchronizes clocks over a network using UDP for quick time updates.

9

IPTV

Delivers television content over IP networks using UDP multicast.

10

Sensor Networks / IoT

UDP is used in constrained environments for fast, low-power communication.

S.No

Feature

Descrption

1

Connectionless Protocol

UDP does not establish a connection before sending data, reducing overhead.

2

Low Latency

Ideal for real-time applications due to minimal delay in data transmission.

3

No Acknowledgment

UDP does not confirm receipt of packets, making it faster but less reliable.

4

No Flow Control

It does not manage data rate between sender and receiver.

5

No Congestion Control

UDP does not reduce transmission rate in response to network congestion.

6

Checksum for Error Detection

Provides basic error checking using a checksum field in the header.

7

Supports Multicast and Broadcast

Efficiently sends data to multiple recipients.

8

Lightweight Header

The UDP header is only 8 bytes, making it efficient for small data packets.

9

Port Numbers

Uses source and destination port numbers to direct data to the correct application.

10

Stateless Communication

Each packet is treated independently, with no memory of previous packets.

Connectionless Protocol - Testcases

S.No

Test Case

Description

Expected Result

1

Send Datagram

Send a single UDP packet

Packet sent successfully

2

Receive Datagram

Receive a UDP packet

Packet received successfully

3

No Handshake

Start communication

No connection setup required

4

No Acknowledgment

Send packet

No ACK expected

5

Packet Loss

Drop packet in transit

No retransmission

6

Packet Duplication

Duplicate packet

Receiver may get multiple copies

7

Packet Reordering

Reorder packets

Receiver gets out-of-order data

8

No Flow Control

Send burst of packets

Receiver may drop excess packets

9

No Congestion Control

Send during congestion

Packets may be lost

10

Stateless Communication

Send without session

Server handles each packet independently

11

Broadcast Packet

Send to broadcast address

All nodes receive packet

12

Multicast Packet

Send to multicast group

Group members receive packet

13

Unicast Packet

Send to single host

Target host receives packet

14

Port Unreachable

Send to closed port

ICMP error may be returned

15

No Retransmission

Drop packet

No retry attempted

16

High Throughput

Send many packets quickly

High-speed transmission

17

Low Latency

Measure delay

Minimal transmission delay

18

Packet Size Limit

Send max-size packet

Packet accepted ( 65,535 bytes)

19

Oversized Packet

Exceed size limit

Packet dropped or fragmented

20

Fragmented Packet

Send fragmented datagram

Reassembled at receiver

21

Corrupted Packet

Simulate bit error

Packet may be discarded

22

No Ordering Guarantee

Send multiple packets

Order not guaranteed

23

Stateless Server

Server handles each request independently

No session tracking

24

Stateless Client

Client sends without session

No connection state

25

Packet with Delay

Introduce delay

Packet still received

26

Packet with Jitter

Vary delay between packets

Receiver handles jitter

27

Packet with Loss

Drop random packets

No retransmission

28

Packet with Duplication

Send same packet twice

Receiver may get duplicates

29

Packet with Reordering

Change packet order

Receiver gets unordered data

30

Packet with TTL Expiry

Set low TTL

Packet discarded en route

31

Packet with Invalid Checksum

Corrupt checksum

Packet dropped

32

Packet with Valid Checksum

Correct checksum

Packet accepted

33

Packet to Invalid IP

Send to wrong address

Packet lost

34

Packet to Valid IP

Send to correct address

Packet received

35

Packet to Closed Port

Send to unused port

ICMP error may be returned

36

Packet to Open Port

Send to listening port

Packet processed

37

Packet Flooding

Send rapid packets

May cause packet loss

38

Packet Logging

Log incoming packets

Logs generated

39

Packet Monitoring

Monitor traffic

Packets visible in sniffer

40

Packet Filtering

Apply firewall rules

Packets blocked or allowed

41

NAT Traversal

Send through NAT

Packet reaches destination

42

VPN Routing

Send over VPN

Packet tunneled successfully

43

Proxy Routing

Send via proxy

Packet forwarded

44

IPv6 Support

Send over IPv6

Packet transmitted

45

IPv4 Support

Send over IPv4

Packet transmitted

46

DNS Query

Send UDP DNS request

Response received

47

VoIP Packet

Send RTP over UDP

Audio transmitted

48

Video Stream

Send video over UDP

Stream received

49

Game Packet

Send game data

Real-time update received

50

UDP Hole Punching

Establish peer-to-peer

Connection established

Low Latency - Testcases

S.No

Test Case

Description

Expected Result

1

Send Small Packet

Transmit minimal data

Packet sent with minimal delay

2

Receive Small Packet

Receive minimal data

Packet received instantly

3

No Handshake Delay

Start communication

No connection setup delay

4

No ACK Delay

No acknowledgment required

Immediate transmission

5

Real-Time Audio

Send audio stream

Audio received with low latency

6

Real-Time Video

Send video stream

Video received with low latency

7

Game Data Transmission

Send game state updates

Updates received in real-time

8

Sensor Data Stream

Send IoT sensor data

Data received with minimal delay

9

DNS Query

Send DNS request

Response received quickly

10

VoIP Packet

Transmit voice packet

Voice heard with low delay

11

Packet with Jitter

Simulate jitter

Latency remains low

12

Packet with Delay

Introduce artificial delay

Delay detected and measured

13

Packet with Loss

Drop packet

No retransmission, latency unaffected

14

Packet with Reordering

Reorder packets

No delay in delivery

15

Packet with Duplication

Duplicate packet

No impact on latency

16

High Throughput

Send many packets quickly

Low latency maintained

17

Low Bandwidth

Send over limited bandwidth

Latency remains acceptable

18

Network Congestion

Simulate congestion

Latency increases slightly

19

No Flow Control

Send burst of packets

Immediate transmission

20

No Congestion Control

Send during congestion

Packets sent without delay

21

NAT Traversal

Send through NAT

Low latency maintained

22

VPN Routing

Send over VPN

Latency remains low

23

Proxy Routing

Send via proxy

Minimal delay added

24

IPv4 Transmission

Send over IPv4

Low latency observed

25

IPv6 Transmission

Send over IPv6

Low latency observed

26

Local Network

Send within LAN

Near-zero latency

27

Wide Area Network

Send over WAN

Acceptable latency

28

Satellite Network

Send via satellite

Higher latency detected

29

Mobile Network

Send over 4G/5G

Low latency maintained

30

Wi-Fi Network

Send over Wi-Fi

Low latency observed

31

Ethernet Network

Send over Ethernet

Very low latency

32

Packet Size Variation

Vary packet sizes

Latency remains low

33

Burst Transmission

Send packets in bursts

Low latency maintained

34

Continuous Stream

Send continuous data

Stream received with low delay

35

Idle Timeout

Resume after idle

Latency remains low

36

Firewall Traversal

Send through firewall

No delay added

37

IDS Monitoring

Monitor for latency

No latency spikes detected

38

Logging Enabled

Log packet timestamps

Latency measurable

39

Logging Disabled

No logging overhead

Latency unaffected

40

Packet Timestamping

Add timestamps

Accurate latency measurement

41

Packet Prioritization

Prioritize UDP packets

Low latency maintained

42

QoS Enabled

Apply QoS rules

Priority packets delivered faster

43

QoS Disabled

No prioritization

Latency may vary

44

UDP Hole Punching

Establish peer-to-peer

Connection setup quickly

45

UDP Broadcast

Send to all nodes

Broadcast received instantly

46

UDP Multicast

Send to group

Multicast received with low delay

47

UDP Unicast

Send to single host

Packet received quickly

48

Packet Fragmentation

Fragment large packet

Reassembled with minimal delay

49

Packet Reassembly

Reassemble fragments

No delay in final delivery

50

Stress Test

High volume, low latency

Latency remains within threshold

No Acknowledgment - Testcases

S.No

Test Case

Description

Expected Result

1

Send Packet

Transmit UDP packet

No ACK expected

2

Receive Packet

Receive UDP packet

No ACK sent

3

Packet Loss

Drop packet

No retransmission or ACK

4

Packet Duplication

Duplicate packet

No ACK, both packets received

5

Packet Reordering

Reorder packets

No ACK, order not guaranteed

6

No Handshake

Start communication

No setup or ACK

7

Stateless Server

Server receives packet

No session or ACK

8

Stateless Client

Client sends packet

No ACK expected

9

Broadcast Packet

Send to all nodes

No ACK from receivers

10

Multicast Packet

Send to group

No ACK from group members

11

Unicast Packet

Send to one host

No ACK from receiver

12

Port Unreachable

Send to closed port

ICMP error may be returned, no ACK

13

Packet with Delay

Delay packet delivery

No ACK, delay tolerated

14

Packet with Jitter

Vary packet timing

No ACK, jitter handled

15

Packet with Loss

Drop packet randomly

No ACK or retry

16

Packet with Duplication

Send same packet twice

No ACK, both may be processed

17

Packet with Reordering

Change packet order

No ACK, receiver handles

18

Packet with TTL Expiry

TTL expires mid-route

No ACK, packet discarded

19

Packet with Invalid Checksum

Corrupt checksum

Packet dropped, no ACK

20

Packet with Valid Checksum

Correct checksum

Packet accepted, no ACK

21

Packet to Invalid IP

Send to wrong address

No ACK, packet lost

22

Packet to Valid IP

Send to correct address

Packet received, no ACK

23

Packet to Closed Port

Send to unused port

ICMP error possible, no ACK

24

Packet to Open Port

Send to listening port

Packet processed, no ACK

25

Packet Flooding

Send rapid packets

No ACK, possible loss

26

Packet Logging

Log incoming packets

No ACK logged

27

Packet Monitoring

Monitor traffic

No ACK observed

28

Packet Filtering

Apply firewall rules

No ACK, packet blocked or allowed

29

NAT Traversal

Send through NAT

No ACK, packet forwarded

30

VPN Routing

Send over VPN

No ACK, packet tunneled

31

Proxy Routing

Send via proxy

No ACK, proxy forwards

32

IPv6 Support

Send over IPv6

No ACK, packet transmitted

33

IPv4 Support

Send over IPv4

No ACK, packet transmitted

34

DNS Query

Send DNS request

Response received, no ACK

35

VoIP Packet

Transmit voice packet

No ACK, real-time delivery

36

Video Stream

Send video over UDP

No ACK, stream continues

37

Game Packet

Send game data

No ACK, real-time update

38

UDP Hole Punching

Establish peer-to-peer

No ACK, connection setup

39

UDP Broadcast

Send to all devices

No ACK expected

40

UDP Multicast

Send to group

No ACK expected

41

UDP Unicast

Send to one device

No ACK expected

42

Packet Fragmentation

Fragment large packet

No ACK, reassembly at receiver

43

Packet Reassembly

Reassemble fragments

No ACK, data reconstructed

44

Logging Disabled

No packet logs

No ACK observed

45

Logging Enabled

Log packet timestamps

No ACK logged

46

Packet Timestamping

Add timestamps

No ACK, timestamps used for analysis

47

Packet Prioritization

Prioritize UDP packets

No ACK, priority respected

48

QoS Enabled

Apply QoS rules

No ACK, faster delivery

49

QoS Disabled

No prioritization

No ACK, standard delivery

50

Stress Test

High volume, no ACK

System handles load without ACKs

No Flow Control - Testcases

S.No

Test Case

Description

Expected Result

1

Rapid Packet Send

Send packets rapidly

Receiver may drop packets

2

Burst Transmission

Send burst of packets

No flow control, possible loss

3

Receiver Overload

Overwhelm receiver buffer

Packets dropped

4

No Window Management

No sliding window used

All packets sent immediately

5

No ACK Feedback

No acknowledgment from receiver

Sender continues sending

6

No Rate Adjustment

Vary network speed

Sender does not adapt

7

Packet Loss

Drop packets during overload

No retransmission

8

Packet Duplication

Duplicate packets

Receiver may process both

9

Packet Reordering

Reorder packets

No correction mechanism

10

Packet Delay

Delay packets

No sender adjustment

11

Packet Jitter

Vary packet timing

No smoothing or control

12

Buffer Overflow

Fill receiver buffer

Packets lost

13

Buffer Underflow

Receiver reads too fast

No impact on sender

14

No Congestion Control

Simulate congestion

Sender continues sending

15

No Throttling

Send at max rate

Receiver may drop packets

16

No Backpressure

Receiver cannot signal sender

Sender unaware of overload

17

No Flow Pause

Receiver cannot pause flow

Packets continue arriving

18

No Flow Resume

No resume signal needed

Sender keeps sending

19

No Flow Negotiation

No initial flow setup

Packets sent immediately

20

No Flow Termination

No graceful end

Packets stop abruptly

21

High-Speed Sender

Send at gigabit speed

Receiver may drop packets

22

Low-Speed Receiver

Slow receiver

Packets dropped due to overflow

23

Mixed Speed Devices

Sender faster than receiver

No flow control, data loss possible

24

IoT Device Receiver

Limited buffer

Packets dropped

25

Mobile Device Receiver

Varying network speed

No sender adjustment

26

Satellite Link

High latency

No flow control, possible loss

27

VPN Tunnel

Send through VPN

No flow control applied

28

NAT Traversal

Send through NAT

No flow control

29

Proxy Routing

Send via proxy

Proxy does not control flow

30

Firewall Traversal

Send through firewall

No flow control enforcement

31

IPv4 Transmission

Send over IPv4

No flow control

32

IPv6 Transmission

Send over IPv6

No flow control

33

DNS Query

Send DNS request

No flow control needed

34

VoIP Stream

Send voice packets

Possible jitter or loss

35

Video Stream

Send video packets

Possible frame drops

36

Game Data

Send game updates

Real-time data may be lost

37

Sensor Data

Send frequent updates

Receiver may miss data

38

UDP Broadcast

Send to all devices

No flow control

39

UDP Multicast

Send to group

No flow control

40

UDP Unicast

Send to one device

No flow control

41

Packet Logging

Log sent packets

No feedback from receiver

42

Packet Monitoring

Monitor traffic

No flow control observed

43

Packet Filtering

Apply firewall rules

No flow control

44

Packet Prioritization

Prioritize packets

No flow control

45

QoS Enabled

Apply QoS rules

No sender-side control

46

QoS Disabled

No prioritization

No flow control

47

Stress Test

High volume test

Receiver drops excess packets

48

Packet Timestamping

Add timestamps

No impact on flow

49

Logging Disabled

No logs

No flow control observed

50

IDS Monitoring

Monitor for overload

Alerts triggered due to lack of control

No Congestion Control - Testcases

S.No

Test Case

Description

Expected Result

1

High Bandwidth Usage

Send large data continuously

No throttling; bandwidth usage spikes

2

Packet Drop Check

Monitor packet loss under load

Increased packet drops

3

Latency Spike

Measure latency during overload

Latency increases significantly

4

No ACK Handling

Disable ACK-based flow control

ACKs ignored; sender keeps sending

5

Buffer Overflow

Fill receiver buffer rapidly

Receiver buffer overflows

6

CPU Load Test

Monitor CPU under high traffic

CPU usage spikes

7

Memory Leak Check

Check memory usage over time

Memory usage increases

8

TCP Window Ignored

Ignore TCP window size

Sender sends beyond window size

9

UDP Flood

Send UDP packets at max rate

No rate limiting; flood continues

10

Network Saturation

Saturate network link

Link fully utilized

11

Jitter Measurement

Measure jitter under load

High jitter observed

12

No Retransmission Delay

Disable retransmission delay

Immediate retransmissions

13

Queue Length Growth

Monitor queue length

Queue grows rapidly

14

No Rate Adaptation

Disable rate adaptation

Constant send rate

15

Packet Reordering

Observe packet order

Increased reordering

16

No ECN Response

Ignore ECN flags

No congestion response

17

Application Crash

Stress test app

App may crash under load

18

No Flow Control

Disable flow control

Sender overwhelms receiver

19

Bandwidth Starvation

Compete with other flows

Other flows starved

20

No Backoff

Disable exponential backoff

Continuous retries

21

Packet Duplication

Check for duplicate packets

Duplicates increase

22

No RTT Adjustment

Ignore RTT changes

RTT not used for control

23

Socket Buffer Overflow

Fill socket buffer

Buffer overflows

24

No Congestion Window

Disable congestion window

Unlimited sending

25

Network Device Overload

Overload NIC

NIC performance degrades

26

No Slow Start

Disable slow start

Full rate from start

27

No Fairness

Compete with TCP flow

TCP flow suffers

28

No Throttling

Disable app-level throttling

App sends at max rate

29

Packet Loss Pattern

Analyze loss pattern

Random or bursty losses

30

No Bandwidth Estimation

Disable bandwidth probing

No adaptive behavior

31

No Queue Management

Disable AQM

Queues fill up

32

No Congestion Feedback

Ignore feedback

No rate adjustment

33

No Pacing

Disable packet pacing

Bursty traffic

34

No Timeout Handling

Disable timeout logic

No retransmission timeout

35

No Flow Isolation

Multiple flows interfere

One flow dominates

36

No Prioritization

All packets equal

No QoS enforcement

37

No Load Balancing

Single path used

Path overloads

38

No Packet Shaping

Disable shaping

Irregular traffic pattern

39

No Logging

Disable congestion logs

No logs generated

40

No Alerts

Disable congestion alerts

No alerts triggered

41

No Retry Limit

Infinite retries

Retry storm

42

No Drop Detection

Ignore drops

No recovery

43

No Congestion Avoidance

Disable avoidance logic

Congestion worsens

44

No Flow Termination

Keep flow alive

Flow never ends

45

No Packet Prioritization

All packets same priority

Critical packets delayed

46

No Adaptive Timeout

Fixed timeout

Inefficient retransmissions

47

No Packet Inspection

Disable DPI

No traffic analysis

48

No Rate Monitoring

Disable rate checks

Unmonitored traffic

49

No Feedback Loop

Disable feedback loop

No control mechanism

50

No Error Correction

Disable FEC

Errors not corrected

Checksum For Error Detection - Testcases

S.No

Test Case

Description

Expected Result

1

Valid Checksum

Send packet with correct checksum

Packet accepted

2

Invalid Checksum

Send packet with incorrect checksum

Packet discarded

3

Checksum Disabled

Disable checksum in header

Packet accepted without validation

4

Corrupted Payload

Modify payload after checksum

Checksum mismatch; packet dropped

5

Header Corruption

Modify header after checksum

Checksum mismatch; packet dropped

6

Zero Checksum

Set checksum to zero

Packet accepted (optional checksum)

7

Checksum Recalculation

Recalculate checksum after change

Packet accepted

8

Checksum Verification

Verify checksum at receiver

Correct checksum validated

9

Checksum Overflow

Test checksum overflow handling

Proper wraparound

10

Checksum Underflow

Test checksum underflow handling

Proper wraparound

11

Large Payload

Send large UDP payload

Checksum calculated correctly

12

Empty Payload

Send empty UDP payload

Valid checksum

13

Fragmented Packet

Send fragmented UDP packet

Checksum validated across fragments

14

Reordered Packet

Reorder fragments

Checksum mismatch

15

Duplicate Packet

Send duplicate packet

Checksum validated

16

Bit Flip in Payload

Flip bit in payload

Checksum mismatch

17

Bit Flip in Header

Flip bit in header

Checksum mismatch

18

Checksum Tampering

Manually alter checksum

Packet dropped

19

IPv4 Checksum

Validate checksum in IPv4

Correct handling

20

IPv6 Checksum

Validate checksum in IPv6

Correct handling

21

Checksum with NAT

Send packet through NAT

Checksum recalculated if needed

22

Checksum with VPN

Send packet through VPN

Checksum validated

23

Checksum with Firewall

Send packet through firewall

Packet dropped if invalid

24

Checksum with Proxy

Send packet through proxy

Checksum validated

25

Checksum with Load Balancer

Send packet through LB

Checksum validated

26

Checksum with QoS

Send packet with QoS tag

Checksum unaffected

27

Checksum with VLAN

Send packet with VLAN tag

Checksum validated

28

Checksum with Tunneling

Send packet through tunnel

Checksum validated

29

Checksum with Encryption

Encrypt payload

Checksum calculated before encryption

30

Checksum with Compression

Compress payload

Checksum calculated after compression

31

Checksum with Multicast

Send multicast packet

Checksum validated

32

Checksum with Broadcast

Send broadcast packet

Checksum validated

33

Checksum with Unicast

Send unicast packet

Checksum validated

34

Checksum with Jumbo Frames

Send jumbo frame

Checksum validated

35

Checksum with Dropped ACK

Drop ACK packet

No impact on checksum

36

Checksum with Retransmission

Retransmit packet

Checksum validated again

37

Checksum with Timeout

Delay packet

Checksum still valid

38

Checksum with Packet Loss

Simulate loss

No checksum validation

39

Checksum with Congestion

Simulate congestion

Checksum validated

40

Checksum with High Latency

Simulate latency

Checksum validated

41

Checksum with Low Latency

Fast delivery

Checksum validated

42

Checksum with Noise

Add noise to channel

Checksum detects corruption

43

Checksum with Bit Error Rate

Simulate BER

Checksum detects errors

44

Checksum with CRC Comparison

Compare with CRC

Checksum less robust

45

Checksum with TCP Comparison

Compare with TCP checksum

UDP checksum simpler

46

Checksum with ICMP

Send ICMP error

Checksum validated

47

Checksum with ARP

Send ARP request

No checksum in ARP

48

Checksum with DNS

Send DNS over UDP

Checksum validated

49

Checksum with DHCP

Send DHCP packet

Checksum validated

50

Checksum with SNMP

Send SNMP over UDP

Checksum validated

Supports Multicast And Broadcast - Testcases

S.No

Test Case

Description

Expected Result

1

Send Broadcast Packet

Send UDP packet to broadcast address

All devices on subnet receive packet

2

Send Multicast Packet

Send UDP packet to multicast group

All group members receive packet

3

Join Multicast Group

Client joins multicast group

Client receives multicast packets

4

Leave Multicast Group

Client leaves multicast group

Client stops receiving packets

5

Broadcast on Local Subnet

Broadcast within subnet

Only local subnet devices receive

6

Broadcast Outside Subnet

Attempt broadcast outside subnet

Packet not forwarded

7

Multicast TTL = 1

Set TTL to 1

Packet not forwarded beyond local network

8

Multicast TTL > 1

Set TTL > 1

Packet forwarded across routers

9

Broadcast with Firewall

Send with firewall enabled

Packet blocked if not allowed

10

Multicast with Firewall

Send with firewall enabled

Packet blocked if not allowed

11

Broadcast with NAT

Send through NAT

Packet may be dropped or altered

12

Multicast with NAT

Send through NAT

Multicast may not be supported

13

Broadcast with VLAN

Send on VLAN

Packet limited to VLAN scope

14

Multicast with VLAN

Send on VLAN

Packet limited to VLAN scope

15

Broadcast Packet Size

Send large broadcast packet

Packet fragmented or dropped

16

Multicast Packet Size

Send large multicast packet

Packet fragmented or dropped

17

Broadcast Packet Loss

Simulate loss

Some devices may not receive

18

Multicast Packet Loss

Simulate loss

Some group members miss packet

19

Broadcast Packet Delay

Introduce delay

All devices receive with delay

20

Multicast Packet Delay

Introduce delay

Group members receive with delay

21

Broadcast Packet Duplication

Duplicate packet

Devices receive multiple copies

22

Multicast Packet Duplication

Duplicate packet

Group members receive multiple copies

23

Broadcast with QoS

Apply QoS

Packet prioritized or deprioritized

24

Multicast with QoS

Apply QoS

Packet prioritized or deprioritized

25

Broadcast with Encryption

Encrypt payload

Devices must decrypt

26

Multicast with Encryption

Encrypt payload

Group members must decrypt

27

Broadcast with Authentication

Add auth header

Devices validate sender

28

Multicast with Authentication

Add auth header

Group members validate sender

29

Broadcast with Logging

Enable logging

Packet logged on all receivers

30

Multicast with Logging

Enable logging

Packet logged on group members

31

Broadcast with Packet Sniffer

Use sniffer

Packet visible on network

32

Multicast with Packet Sniffer

Use sniffer

Packet visible to group only

33

Broadcast with Packet Tampering

Modify packet

Receivers detect corruption

34

Multicast with Packet Tampering

Modify packet

Group detects corruption

35

Broadcast with High Traffic

Send many packets

Network congestion possible

36

Multicast with High Traffic

Send many packets

Group congestion possible

37

Broadcast with Low Bandwidth

Limit bandwidth

Packet loss or delay

38

Multicast with Low Bandwidth

Limit bandwidth

Packet loss or delay

39

Broadcast with Multiple Interfaces

Send from multiple NICs

Packet sent on all interfaces

40

Multicast with Multiple Interfaces

Send from multiple NICs

Packet sent on selected interface

41

Broadcast with Loopback

Send to loopback

Packet not broadcasted

42

Multicast with Loopback

Send to loopback

Packet not multicast

43

Broadcast with IPv6

Use IPv6 broadcast

Not supported (use multicast)

44

Multicast with IPv6

Use IPv6 multicast

Packet delivered to group

45

Broadcast with Socket Reuse

Reuse socket

Multiple apps receive

46

Multicast with Socket Reuse

Reuse socket

Multiple apps receive

47

Broadcast with TTL

Set TTL

TTL ignored for broadcast

48

Multicast with Interface Binding

Bind to interface

Packet sent on bound interface

49

Broadcast with Port Conflict

Use same port

Conflict or shared delivery

50

Multicast with Port Conflict

Use same port

Conflict or shared delivery

Lightweight Header - Testcases

S.No

Test Case

Description

Expected Result

1

Basic Header Validation

Check standard UDP header fields

All fields present and correct

2

Header Size Check

Measure UDP header size

Exactly 8 bytes

3

No Extra Fields

Ensure no additional header fields

Only source port, dest port, length, checksum

4

Header Parsing

Parse header at receiver

Successful parsing

5

Header Corruption

Corrupt header bits

Packet dropped

6

Header Compression

Attempt compression

No effect; already minimal

7

Header Expansion Attempt

Add extra fields

Packet rejected

8

Header with IPv4

Send over IPv4

8-byte UDP header used

9

Header with IPv6

Send over IPv6

8-byte UDP header used

10

Header with Fragmentation

Fragment packet

Header remains intact per fragment

11

Header with NAT

Send through NAT

Header translated correctly

12

Header with Firewall

Send through firewall

Header inspected correctly

13

Header with VPN

Send through VPN

Header preserved

14

Header with VLAN

Send on VLAN

Header unaffected

15

Header with QoS

Apply QoS

Header remains unchanged

16

Header with Encryption

Encrypt payload

Header not encrypted

17

Header with Compression

Compress payload

Header not compressed

18

Header with Broadcast

Send broadcast

Header used as-is

19

Header with Multicast

Send multicast

Header used as-is

20

Header with Loopback

Send to loopback

Header parsed correctly

21

Header with Socket Reuse

Reuse socket

Header reused correctly

22

Header with Port Conflict

Use same port

Header identifies correct flow

23

Header with Checksum

Validate checksum field

Correct checksum

24

Header with Zero Checksum

Set checksum to zero

Packet accepted (optional)

25

Header with Invalid Checksum

Corrupt checksum

Packet dropped

26

Header with Large Payload

Send large payload

Header handles size correctly

27

Header with Empty Payload

Send empty payload

Header still valid

28

Header with TTL

TTL in IP header only

UDP header unaffected

29

Header with ICMP Error

Trigger ICMP error

Header used for error reporting

30

Header with DNS

Send DNS over UDP

Header used correctly

31

Header with DHCP

Send DHCP over UDP

Header used correctly

32

Header with SNMP

Send SNMP over UDP

Header used correctly

33

Header with RTP

Send RTP over UDP

Header used correctly

34

Header with SIP

Send SIP over UDP

Header used correctly

35

Header with TFTP

Send TFTP over UDP

Header used correctly

36

Header with NTP

Send NTP over UDP

Header used correctly

37

Header with Custom Protocol

Send custom UDP payload

Header used correctly

38

Header with Bit Flip

Flip bit in header

Packet dropped

39

Header with Delay

Delay packet

Header still valid

40

Header with Jitter

Introduce jitter

Header unaffected

41

Header with Packet Loss

Simulate loss

Header not recovered

42

Header with Retransmission

Retransmit packet

Header reused

43

Header with Logging

Log header fields

All fields logged correctly

44

Header with Monitoring Tool

Use sniffer

Header visible and correct

45

Header with Load Balancer

Send through LB

Header used for routing

46

Header with Proxy

Send through proxy

Header preserved

47

Header with Bitrate Control

Control bitrate

Header unaffected

48

Header with Interface Binding

Bind to interface

Header used correctly

49

Header with IPv6 Extension

Use IPv6 extension headers

UDP header remains 8 bytes

50

Header with Header Analyzer

Use analyzer tool

Header fields correctly identified

Port Numbers - Testcases

S.No

Test Case

Description

Expected Result

1

Valid Port Range

Use port number between 065535

Packet accepted

2

Reserved Port Usage

Use reserved port (e.g., 53 for DNS)

Packet routed to correct service

3

Invalid Port Number

Use port > 65535

Packet rejected

4

Negative Port Number

Use negative port

Packet rejected

5

Port Number Zero

Use port 0

Packet accepted (source only)

6

Port Conflict

Use same port for multiple apps

Apps may share or conflict

7

Dynamic Port Allocation

Use ephemeral port

Port assigned dynamically

8

Static Port Assignment

Assign fixed port

Packet routed correctly

9

Port Reuse

Enable socket reuse

Multiple apps receive packet

10

Port Binding Failure

Bind to used port

Binding fails

11

Port Binding Success

Bind to free port

Binding succeeds

12

Port Filtering

Block specific port via firewall

Packet dropped

13

Port Forwarding

Forward port via NAT

Packet redirected correctly

14

Port Scanning Detection

Scan ports

Detection triggered

15

Port Range Scan

Scan range of ports

All open ports identified

16

Port with Broadcast

Send to broadcast address

Packet sent to all on port

17

Port with Multicast

Send to multicast group

Packet received by group on port

18

Port with Loopback

Send to loopback

Packet received locally

19

Port with IPv6

Use port with IPv6

Packet routed correctly

20

Port with IPv4

Use port with IPv4

Packet routed correctly

21

Port with DNS

Use port 53

DNS service responds

22

Port with DHCP

Use port 67/68

DHCP service responds

23

Port with SNMP

Use port 161

SNMP service responds

24

Port with TFTP

Use port 69

TFTP service responds

25

Port with NTP

Use port 123

NTP service responds

26

Port with RTP

Use port 5004

RTP stream received

27

Port with SIP

Use port 5060

SIP service responds

28

Port with Custom App

Use custom port

App receives packet

29

Port with Logging

Log port usage

Port logged correctly

30

Port with Monitoring Tool

Use sniffer

Port visible in capture

31

Port with Encryption

Encrypt payload

Port remains visible

32

Port with Compression

Compress payload

Port unaffected

33

Port with NAT Traversal

Use STUN/TURN

Port mapped correctly

34

Port with VPN

Send through VPN

Port preserved

35

Port with VLAN

Send on VLAN

Port used correctly

36

Port with QoS

Apply QoS

Port used for classification

37

Port with Load Balancer

Send through LB

Port used for routing

38

Port with Proxy

Send through proxy

Port preserved or translated

39

Port with TTL

TTL in IP header

Port unaffected

40

Port with Fragmentation

Fragment packet

Port info in each fragment

41

Port with Delay

Delay packet

Port info preserved

42

Port with Packet Loss

Simulate loss

Port info lost with packet

43

Port with Retransmission

Retransmit packet

Port info reused

44

Port with Bit Flip

Flip bit in port field

Packet misrouted or dropped

45

Port with Header Tampering

Modify header

Port info corrupted

46

Port with Logging Disabled

Disable logging

Port info not recorded

47

Port with High Traffic

Send many packets

Port handles load

48

Port with Low Traffic

Send few packets

Port remains open

49

Port with Timeout

Idle port

Port may close

50

Port with Error Handling

Send to closed port

ICMP error returned

Stateless Communication - Testcases

S.No

Test Case

Description

Expected Result

1

Valid Port Range

Use port number between 065535

Packet accepted

2

Reserved Port Usage

Use reserved port (e.g., 53 for DNS)

Packet routed to correct service

3

Invalid Port Number

Use port > 65535

Packet rejected

4

Negative Port Number

Use negative port

Packet rejected

5

Port Number Zero

Use port 0

Packet accepted (source only)

6

Port Conflict

Use same port for multiple apps

Apps may share or conflict

7

Dynamic Port Allocation

Use ephemeral port

Port assigned dynamically

8

Static Port Assignment

Assign fixed port

Packet routed correctly

9

Port Reuse

Enable socket reuse

Multiple apps receive packet

10

Port Binding Failure

Bind to used port

Binding fails

11

Port Binding Success

Bind to free port

Binding succeeds

12

Port Filtering

Block specific port via firewall

Packet dropped

13

Port Forwarding

Forward port via NAT

Packet redirected correctly

14

Port Scanning Detection

Scan ports

Detection triggered

15

Port Range Scan

Scan range of ports

All open ports identified

16

Port with Broadcast

Send to broadcast address

Packet sent to all on port

17

Port with Multicast

Send to multicast group

Packet received by group on port

18

Port with Loopback

Send to loopback

Packet received locally

19

Port with IPv6

Use port with IPv6

Packet routed correctly

20

Port with IPv4

Use port with IPv4

Packet routed correctly

21

Port with DNS

Use port 53

DNS service responds

22

Port with DHCP

Use port 67/68

DHCP service responds

23

Port with SNMP

Use port 161

SNMP service responds

24

Port with TFTP

Use port 69

TFTP service responds

25

Port with NTP

Use port 123

NTP service responds

26

Port with RTP

Use port 5004

RTP stream received

27

Port with SIP

Use port 5060

SIP service responds

28

Port with Custom App

Use custom port

App receives packet

29

Port with Logging

Log port usage

Port logged correctly

30

Port with Monitoring Tool

Use sniffer

Port visible in capture

31

Port with Encryption

Encrypt payload

Port remains visible

32

Port with Compression

Compress payload

Port unaffected

33

Port with NAT Traversal

Use STUN/TURN

Port mapped correctly

34

Port with VPN

Send through VPN

Port preserved

35

Port with VLAN

Send on VLAN

Port used correctly

36

Port with QoS

Apply QoS

Port used for classification

37

Port with Load Balancer

Send through LB

Port used for routing

38

Port with Proxy

Send through proxy

Port preserved or translated

39

Port with TTL

TTL in IP header

Port unaffected

40

Port with Fragmentation

Fragment packet

Port info in each fragment

41

Port with Delay

Delay packet

Port info preserved

42

Port with Packet Loss

Simulate loss

Port info lost with packet

43

Port with Retransmission

Retransmit packet

Port info reused

44

Port with Bit Flip

Flip bit in port field

Packet misrouted or dropped

45

Port with Header Tampering

Modify header

Port info corrupted

46

Port with Logging Disabled

Disable logging

Port info not recorded

47

Port with High Traffic

Send many packets

Port handles load

48

Port with Low Traffic

Send few packets

Port remains open

49

Port with Timeout

Idle port

Port may close

50

Port with Error Handling

Send to closed port

ICMP error returned

S.No

UDP Header

Description

Size(Bytes)

Position(bits)

1

Source Port

Identifies the sending port number.

2

015

2

Destination Port

Identifies the receiving port number.

2

1631

3

Length

Specifies the length of the UDP header and data.

2

3247

4

Checksum

Used for error-checking of the header and data.

2

4863

S.No

Protocol/Application

Descrption

1

DNS (Domain Name System)

Resolves domain names to IP addresses using fast, connectionless queries.

2

DHCP (Dynamic Host Configuration Protocol)

Assigns IP addresses and network configuration to devices.

3

TFTP (Trivial File Transfer Protocol)

A simple protocol for transferring files with minimal overhead.

4

SNMP (Simple Network Management Protocol)

Monitors and manages network devices like routers and switches.

5

NTP (Network Time Protocol)

Synchronizes clocks across computer systems over packet-switched networks.

6

RTP (Real-time Transport Protocol)

Delivers audio and video over IP networks, often used in streaming and VoIP.

7

VoIP (Voice over IP)

Enables voice communication over the internet with low latency.

8

IPTV (Internet Protocol Television)

Streams television content over IP networks using multicast UDP.

9

QUIC (Quick UDP Internet Connections)

A modern transport protocol built on UDP, offering faster and secure connections.

10

Multicast Streaming

Distributes data to multiple recipients simultaneously, commonly used in live broadcasts.

S.no

General Socket-Level Options

Explanation

Details

1

SO_BROADCAST

SO_BROADCAST is a socket option that allows a UDP socket to send datagrams to broadcast

Header: <sys/socket.h>

addresses, such as 192.168.1.255.

Level: SOL_SOCKET

Purpose

To enable a socket to transmit messages to all hosts on a subnet using a broadcast address.

Useful in service discovery, alerts, and DHCP

Type

This means the option is set using an integer value, but it behaves like a boolean flag.

Boolean (int)

Values

0 = Disabled: The socket is not allowed to send datagrams to broadcast addresses

0 = Disabled, 1 = Enabled

1 = Enabled: The socket is allowed to send to broadcast addresses.

Default Value

By default, broadcasting is disabled for security and network efficiency reasons. If you try to send to a broadcast address without enabling this option, the system will return a Permission denied error.

zero

2

SO_REUSEADDR

SO_REUSEADDR is a socket option that allows multiple sockets to bind to the same local IP

Header: <sys/socket.h>

address and port combination, under certain conditions.

Level: SOL_SOCKET

Purpose

To allow quick reuse of a port after a socket is closed, or to allow multiple sockets to bind to

the same port

Type

Though conceptually a boolean, it’s implemented as an integer (0 or 1) in system calls.

Boolean

values

0- If a server crashes or is restarted quickly, it may not be able to bind to the same port until

0 = Disabled (default)

the OS releases it. 1-server can immediately rebind to the same port, improving uptime and flexibility.

1 = Enabled

Default Value

Reuse is disabled by default to avoid accidental port conflicts.

0

3

SO_RCVBUF

SO_RCVBUF is a socket option that sets the size of the receive buffer used by the kernel

Header: <sys/socket.h>

for incoming data on a socket.

Level: SOL_SOCKET

Purpose

To control how much incoming data can be buffered by the kernel before being read by the

application. Larger buffers help prevent packet loss during bursts.

Type

The size of the buffer is specified in bytes.

Integer (bytes)

Values

The kernel may double the value internally for overhead.

Any positive integer

Default Value

System-dependent (commonly 212992 bytes).

System-dependent (e.g., 212992)

Can be checked via /proc/sys/net/core/rmem_default.

4

SO_SNDBUF

SO_SNDBUF is a socket option that sets the size of the send buffer used by the kernel for

Header: <sys/socket.h>

outgoing data on a socket.

Level: SOL_SOCKET

Purpose

To control how much data can be queued in the kernel before being sent over the network.

Larger buffers help in high-throughput or high-latency networks.

Type

The size of the buffer is specified in bytes.

Integer (bytes)

Values

Any positive integer

(e.g., 8192, 65536, 262144, etc.)

Default Value

System-dependent (commonly 16384 or 212992 bytes).

System-dependent (e.g., 212992)

Can be checked via /proc/sys/net/core/wmem_default.

5

SO_RCVTIMEO

SO_RCVTIMEO is a socket option that sets a timeout value for receiving data on a socket.

Header: <sys/socket.h>

If no data is received within the specified time, the recv() or recvfrom() call will return with an

Level: SOL_SOCKET

error.

Purpose

To prevent a socket from blocking indefinitely while waiting for incoming data. Useful in

applications that require responsiveness or timeout handling.

Type

A structure with two fields: tv_sec (seconds) and tv_usec (microseconds).

struct timeval

Values

Any valid struct timeval value

e.g., tv_sec = 5, tv_usec = 0 sets a 5-second timeout.

Default Value

The socket will wait indefinitely for data unless a timeout is explicitly set.

Default: Blocking (no timeout)

6

SO_SNDTIMEO

SO_SNDTIMEO is a socket option that sets a timeout value for sending data on a socket.

Header: <sys/socket.h>

If the data cannot be sent within the specified time, the send() or sendto() call will return error.

Level: SOL_SOCKET

Purpose

To prevent a socket from blocking indefinitely while trying to send data. Useful in applications that

require responsiveness or timeout handling.

Type

A structure with two fields: tv_sec (seconds) and tv_usec (microseconds).

struct timeval

Values

Any valid struct timeval value

tv_sec = 3, tv_usec = 0 sets a 3-second timeout.

Default Value

The socket will wait indefinitely to send data unless a timeout is explicitly set.

Default: Blocking (no timeout)

7

SO_TIMESTAMP

SO_TIMESTAMP is a socket option that enables the recording of the arrival time of incoming

Header: <sys/socket.h>

datagrams. The timestamp is attached as ancillary data to each received message.

Level: SOL_SOCKET

Purpose

To allow applications to retrieve the exact time a datagram was received by the kernel.

Useful for logging, latency measurement, and time-sensitive applications.

Type

Though conceptually a boolean, it’s implemented as an integer (0 or 1).

Boolean

Values

When enabled, each received packet includes a timestamp (in struct timeval format) in the control

0 = Disabled (default)

message metadata. This is accessed via recvmsg() instead of recvfrom().

1 = Enabled

Default Value

Timestamping is disabled by default.

0

8

IP_MULTICAST_TTL

IP_MULTICAST_TTL is a socket option that sets the Time-To-Live (TTL) value for outgoing multicast

Header: <netinet/in.h>

packets. TTL determines how many network hops a packet can traverse.

Level: IPPROTO_IP

Purpose

To control the scope or reach of multicast traffic. A lower TTL restricts packets to the local network;

a higher TTL allows them to travel across multiple routers.

Type

The TTL value is an 8-bit integer.

Integer (0255)

Values

0 = Restricted to the same host

0,1,>1

1 = Restricted to the same subnet

>1 = Can traverse multiple subnets depending on the value

Default Value

By default, multicast packets are limited to the local subnet.

1

9

IP_MULTICAST_LOOP

IP_MULTICAST_LOOP is a socket option that controls whether multicast packets sent from a socket

are looped back and received by the same socket on the sending host.

Purpose

To allow or prevent the sender from receiving its own multicast transmissions. Useful for testing,

diagnostics, or applications that need to monitor their own multicast traffic.

Type

Though conceptually a boolean, it’s implemented as an integer (0 or 1).

Boolean

Values

0 =Disabled The sender does not receive its own multicast packets.

0= Disabled

1 = Enabled The sender does receive its own multicast packets.

1 = Enabled

Default Value

Loopback is enabled by default.

1

10

IP_ADD_MEMBERSHIP

IP_ADD_MEMBERSHIP is a socket option used to join a multicast group on a specified interface,

Header: <netinet/in.h>

enabling the socket to receive multicast traffic sent to that group.

Level: IPPROTO_IP

Purpose

To allow a UDP socket to subscribe to a multicast group and receive datagrams addressed to

that group IP.

Type

struct ip_mreq A structure containing:

struct ip_mreq

imr_multiaddr: the multicast group address

imr_interface: the local interface address to join on

Values

A valid ip_mreq structure with:

(e.g., 239.0.0.1)

imr_multiaddr = multicast group IP (e.g., 239.0.0.1)

(e.g., 0.0.0.0 for default)

imr_interface = local IP (e.g., 0.0.0.0 for default)

Default Value

The socket is not a member of any multicast group by default.

Not applicable

11

IP_DROP_MEMBERSHIP

A socket option used with setsockopt() to instruct the kernel to leave a multicast group on a

Header: <netinet/in.h>

specified interface.

Level: IPPROTO_IP

Purpose

Used to leave a multicast group on a specified interface.

Type

a structure that specifies the multicast group and the local interface.

struct ip_mreq

Values

A structure that specifies:

imr_multiaddr: the multicast group IP address to leave

imr_interface: the local interface IP address

Default Value

You must explicitly provide both imr_multiaddr and imr_interface. There is no default multicast

None

group or interface.

12

IP_PKTINFO

A socket option that allows an application to receive ancillary data (control messages) containing

Header: <netinet/in.h>

the destination IP address, interface index, and local address for incoming IPv4 datagrams.

Level: IPPROTO_IP

Purpose

When enabled, the kernel includes a struct in_pktinfo in the control message of received datagrams,which provides metadata about how the packet was received.

Type

(used with setsockopt() and getsockopt() to enable or disable the option)

Boolean

Values

0 (disabled):

0 (disabled), 1 (enabled)

By default, the socket does not receive extra information like destination address or interface index.

1 (enabled):

When set, the socket receives ancillary data with each incoming datagram. This data includes:

The destination IP address the packet was sent to

The interface index on which the packet was received

The local address used to receive the packet

Default Value

the socket will not receive any packet metadata like interface or destination address.

0

This keeps socket behavior simple and lightweight unless such details are needed.

13

IP_RECVTTL

A socket option that enables an application to receive the TTL (Time To Live) value of incoming

Header: <netinet/in.h>

IPv4 datagrams as ancillary data.

Level: IPPROTO_IP

Purpose

Allows a socket to receive the TTL (Time To Live) value of incoming IPv4 datagrams.

Type

this value to setsockopt() to turn the option on or off.

Boolean (int)

Values

0 (disabled): TTL is not received.

0 Disabled

1 (enabled): TTL is included in the control message (cmsghdr) of received datagrams.

1 Enabled

Default Value

By default, the socket does not receive TTL information. This keeps packet processing lightweight

Default: 0

unless TTL is explicitly needed.

14

IP_TOS

IP_TOS is a socket option that allows an application to set the Type of Service (ToS) field in the IP

Header: <netinet/in.h>

header of outgoing IPv4 packets. This 8-bit field can influence how routers and network devices handle the packet, based on service preferences like delay, throughput, reliability, or cost.

Level: IPPROTO_IP

Purpose

Sets the Type of Service (ToS) field in the IP header of outgoing IPv4 packets. This field can influence

how routers handle the packet

Type

each bit or group of bits can represent different service preferences.

Integer (0255)

Commonly used with DSCP (Differentiated Services Code Point) and ECN

(Explicit Congestion Notification).

Values

These values are set using setsockopt() and are placed in the ToS byte of the IP header.

0x10 (Low Delay)

The ToS byte has evolved into the DSCP (6 bits) + ECN (2 bits) format in modern networks.

0x08 (High Throughput)

can combine values using bitwise OR, but in practice, DSCP values are preferred for fine-grained QoS.

0x04 (High Reliability)

0x02 (Minimize Cost)

Custom DSCP values

Default Value

Default ToS value means no special handling is requested; packets are treated with normal

Default: 0

priority and routing behavior

15

IP_RECVTOS

A socket option that allows an application to receive the Type of Service (ToS) field from the

Header: <netinet/in.h>

IP header of incoming IPv4 packets.

Level: IPPROTO_IP

Purpose

Enables the application to access the ToS byte (which includes DSCP and ECN bits) from received

packets, useful for diagnostics, QoS monitoring, or routing decisions.

Type

this value to setsockopt() to turn the option on or off.

Boolean (int)

Values

0 ToS field is not received.

0 Disabled

1 ToS field is included in the control message (cmsghdr) of incoming datagrams.

1 Enabled

Default Value

The socket does not receive ToS information unless explicitly enabled.

0 Disabled by default

S.No

Parameter Name

Description

File Path

1

udp_mem

Memory thresholds for all UDP sockets: [low, pressure, high] in pages.

/proc/sys/net/ipv4/udp_mem

2

udp_rmem_min

Minimum receive buffer size for UDP sockets.

/proc/sys/net/ipv4/udp_rmem_min

3

udp_wmem_min

Minimum send buffer size for UDP sockets.

/proc/sys/net/ipv4/udp_wmem_min

4

udp_l3mdev_accept

Accept UDP traffic on L3 master devices (e.g., VRFs).

/proc/sys/net/ipv4/udp_l3mdev_accept

5

udp_early_demux

Enables early demultiplexing of UDP packets.

/proc/sys/net/ipv4/udp_early_demux

6

udp_encap_enable

Enables UDP encapsulation support (e.g., for IPsec or GTP-U).

/proc/sys/net/ipv4/udp_encap_enable

7

udp_tunnel_nic_info

Provides information about UDP tunnel NICs.

/proc/sys/net/ipv4/udp_tunnel_nic_info

8

udp_checksum

Enables or disables UDP checksumming for IPv4.

/proc/sys/net/ipv4/udp_checksum

9

udp_no_check6_rx

Disable checksum verification for incoming IPv6 UDP packets.

/proc/sys/net/ipv6/udp_no_check6_rx

10

udp_no_check6_tx

Disable checksum generation for outgoing IPv6 UDP packets.

/proc/sys/net/ipv6/udp_no_check6_tx

11

udp_port_randomization

Controls the range of ephemeral ports used by UDP.

/proc/sys/net/ipv4/ip_local_port_range

12

udp_socket_buffer_limit

Max receive buffer size for all UDP sockets.

/proc/sys/net/core/rmem_max

13

udp_socket_send_buffer

Max send buffer size for all UDP sockets.

/proc/sys/net/core/wmem_max

14

udp_default_rmem

Default receive buffer size for UDP sockets.

/proc/sys/net/core/rmem_default

15

udp_default_wmem

Default send buffer size for UDP sockets.

/proc/sys/net/core/wmem_default

16

udp_max_backlog

Max number of packets in the input queue.

/proc/sys/net/core/netdev_max_backlog

17

udp_bpf_jit_enable

Enables BPF JIT for UDP packet filtering.

/proc/sys/net/core/bpf_jit_enable

18

udp_bpf_jit_harden

Enables hardening for BPF JIT.

/proc/sys/net/core/bpf_jit_harden

19

udp_bpf_jit_kallsyms

Export BPF JIT symbols for debugging.

/proc/sys/net/core/bpf_jit_kallsyms

20

udp_max_orphans

Max orphaned sockets (applies to UDP too).

/proc/sys/net/ipv4/tcp_max_orphans

21

udp_max_qlen

Max ancillary data (control messages) per socket.

/proc/sys/net/core/optmem_max

22

udp_fragmentation

High threshold for IP fragmentation (affects UDP too).

/proc/sys/net/ipv4/ipfrag_high_thresh

23

udp_fragmentation_low

Low threshold for IP fragmentation.

/proc/sys/net/ipv4/ipfrag_low_thresh

24

udp_fragmentation_timeout

Timeout for IP fragments (in seconds).

/proc/sys/net/ipv4/ipfrag_time

25

udp_local_port_range

Range of ephemeral ports used by UDP.

/proc/sys/net/ipv4/ip_local_port_range

26

udp_autobind_reuse

Allow reuse of autobound ports.

/proc/sys/net/ipv4/udp_autobind_reuse

27

udp_queue_rcvbuf_expiry

Time budget for processing UDP receive queue.

/proc/sys/net/core/netdev_budget_usecs

28

udp_rcvbuf_pressure

Pressure threshold for UDP receive buffer.

/proc/sys/net/core/rmem_pressure

29

udp_sndbuf_pressure

Pressure threshold for UDP send buffer.

/proc/sys/net/core/wmem_pressure

30

udp_checksum_offload

Affects checksum offloading behavior.

/proc/sys/net/core/dev_weight

31

udp_gro_receive_limit

Max number of UDP packets processed in GRO batch.

/proc/sys/net/core/gro_normal_batch_limit

32

udp_gro_flush_timeout

Timeout for flushing GRO UDP packets.

/proc/sys/net/core/gro_flush_timeout

33

udp_gso_max_segs

Max number of segments in a UDP GSO packet.

/proc/sys/net/core/gso_max_segs

34

udp_gso_max_size

Max size of a UDP GSO packet.

/proc/sys/net/core/gso_max_size

35

udp_napi_weight

NAPI weight for UDP packet processing.

/proc/sys/net/core/dev_weight

36

udp_napi_budget

Max number of packets processed per NAPI poll.

/proc/sys/net/core/netdev_budget

37

udp_napi_budget_usecs

Time budget for NAPI polling.

/proc/sys/net/core/netdev_budget_usecs

38

udp_rps_sock_flow_entries

Number of flow entries for UDP RPS (Receive Packet Steering).

/proc/sys/net/core/rps_sock_flow_entries

39

udp_rps_cpus

CPU mask for RPS (affects UDP).

/proc/sys/net/core/rps_cpus

40

udp_xps_cpus

CPU mask for XPS (Transmit Packet Steering).

/proc/sys/net/core/xps_cpus

41

udp_xps_map

Mapping of queues to CPUs for UDP XPS.

/proc/sys/net/core/xps_map

42

udp_flow_limit

Max number of UDP flows tracked.

/proc/sys/net/core/flow_limit_table_len

43

udp_flow_timeout

Timeout for UDP flow tracking.

/proc/sys/net/core/flow_limit_table_timeout

44

udp_flow_gc_interval

Interval for garbage collecting UDP flows.

/proc/sys/net/core/flow_limit_gc_interval

45

udp_flow_limit_enable

Enables UDP flow limiting.

/proc/sys/net/core/flow_limit_enable

46

udp_flow_limit_burst

Burst size for UDP flow limiting.

/proc/sys/net/core/flow_limit_burst

47

udp_flow_limit_rate

Rate limit for UDP flows.

/proc/sys/net/core/flow_limit_rate

48

udp_flow_limit_log

Enables logging for UDP flow limiting.

/proc/sys/net/core/flow_limit_log

49

udp_flow_limit_log_thresh

Threshold for logging UDP flow drops.

/proc/sys/net/core/flow_limit_log_thresh

50

udp_flow_limit_log_burst

Burst size for UDP flow log messages.

/proc/sys/net/core/flow_limit_log_burst

51

udp_flow_limit_log_rate

Rate of UDP flow log messages.

/proc/sys/net/core/flow_limit_log_rate

52

udp_flow_limit_log_level

Log level for UDP flow messages.

/proc/sys/net/core/flow_limit_log_level

53

udp_flow_limit_log_prefix

Prefix for UDP flow log messages.

/proc/sys/net/core/flow_limit_log_prefix

54

udp_flow_limit_log_file

File path for UDP flow logs.

/proc/sys/net/core/flow_limit_log_file

55

udp_flow_limit_log_format

Format string for UDP flow logs.

/proc/sys/net/core/flow_limit_log_format

56

udp_flow_limit_log_flags

Flags for UDP flow log behavior.

/proc/sys/net/core/flow_limit_log_flags

57

udp_flow_limit_log_mask

Mask for filtering UDP flow logs.

/proc/sys/net/core/flow_limit_log_mask

58

udp_flow_limit_log_filter

Filter expression for UDP flow logs.

/proc/sys/net/core/flow_limit_log_filter

59

udp_flow_limit_log_action

Action to take on UDP flow limit log match.

/proc/sys/net/core/flow_limit_log_action

60

udp_flow_limit_log_notify

Notify user-space on UDP flow limit log match.

/proc/sys/net/core/flow_limit_log_notify

61

udp_autocorking

Enables automatic corking of small UDP packets to reduce overhead.

/proc/sys/net/ipv4/udp_autocorking

62

udp_max_segment_size

Maximum segment size for UDP GSO packets.

/proc/sys/net/core/udp_max_segment_size

63

udp_gro_enabled

Enables Generic Receive Offload for UDP.

/proc/sys/net/core/udp_gro_enabled

64

udp_gso_enabled

Enables Generic Segmentation Offload for UDP.

/proc/sys/net/core/udp_gso_enabled

65

udp_gro_flush_interval

Interval to flush GRO UDP packets (in ms).

/proc/sys/net/core/udp_gro_flush_interval

66

udp_gso_flush_interval

Interval to flush GSO UDP packets (in ms).

/proc/sys/net/core/udp_gso_flush_interval

67

udp_checksum_policy

Policy for enforcing UDP checksums in IPv6.

/proc/sys/net/ipv6/udp_checksum_policy

68

udp_zero_checksum_accept

Accept IPv6 UDP packets with zero checksum.

/proc/sys/net/ipv6/udp_zero_checksum_accept

69

udp_zero_checksum_transmit

Transmit IPv6 UDP packets with zero checksum.

/proc/sys/net/ipv6/udp_zero_checksum_transmit

70

udp_flow_cache_size

Size of the UDP flow cache.

/proc/sys/net/core/udp_flow_cache_size

71

udp_flow_cache_timeout

Timeout for entries in the UDP flow cache.

/proc/sys/net/core/udp_flow_cache_timeout

72

udp_flow_cache_gc_interval

Interval for garbage collection of UDP flow cache.

/proc/sys/net/core/udp_flow_cache_gc_interval

73

udp_flow_cache_enable

Enables UDP flow cache.

/proc/sys/net/core/udp_flow_cache_enable

74

udp_flow_cache_log

Enables logging for UDP flow cache events.

/proc/sys/net/core/udp_flow_cache_log

75

udp_flow_cache_log_level

Log level for UDP flow cache messages.

/proc/sys/net/core/udp_flow_cache_log_level

76

udp_flow_cache_log_prefix

Prefix for UDP flow cache log messages.

/proc/sys/net/core/udp_flow_cache_log_prefix

77

udp_flow_cache_log_file

File path for UDP flow cache logs.

/proc/sys/net/core/udp_flow_cache_log_file

78

udp_flow_cache_log_format

Format string for UDP flow cache logs.

/proc/sys/net/core/udp_flow_cache_log_format

79

udp_flow_cache_log_flags

Flags for UDP flow cache log behavior.

/proc/sys/net/core/udp_flow_cache_log_flags

80

udp_flow_cache_log_notify

Notify user-space on UDP flow cache log match.

/proc/sys/net/core/udp_flow_cache_log_notify

  • Reference links