GSOC2025IcmpSocket: Difference between revisions

From Nsnam
Jump to navigation Jump to search
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 9: Line 9:
* '''Mentors:''' Tommaso Pecorella and Alberto Gallegos Ramonet
* '''Mentors:''' Tommaso Pecorella and Alberto Gallegos Ramonet
* '''Google page:'''  
* '''Google page:'''  
* '''Project Goals: Develop an ICMP socket according to LINUX implementation of ICMP SOCK_DGRAM'''  
* '''Project Goals: Develop an ICMP socket according to LINUX implementation of ICMP SOCK_DGRAM. Currently, for sending ICMP packets, the application has to use a Raw socket. This results in having the user write all the code for adding the headers, the filtering, etc. The proposed ICMP socket aims to offload all this functionality from the user and provide the user with API's required for sending and receiving packets, filtering etc.'''  
* '''Repository:'''  
* '''Repo:''' https://gitlab.com/ADI-ROXX/ns-3-dev
* '''About Me:'''


= Milestones =
'''Phase 1: Fix the fragmentation issue in Raw sockets''' 
[https://gitlab.com/nsnam/ns-3-dev/-/merge_requests/2486 Merge Request] 
* '''Changes made:''' 
** '''Forward assembled packets:''' In case of '''raw sockets''', forward the packet up to the '''application''' after the '''re-assembly''', not before that (existing implementation) 
** '''Test cases:''' Wrote the test case for '''IPv4''' and '''IPv6 Raw sockets''' that ensure that only a single assembled packet is received. Also, included the test cases for '''Ping application''' with fragmentation. 
'''Phase 2: Implementation of the ICMP socket''' 
[https://gitlab.com/nsnam/ns-3-dev/-/merge_requests/2527 Merge Request] 
* '''Changes''' 
** '''ICMP error messages:''' Integrated support for sending '''ICMP Destination Unreachable''' messages from the '''IP layer''' upon packet drop. 
** '''ICMP socket:''' Implemented a dedicated '''ICMP socket''', the '''LLD''' of which is similar to that of the '''UDP socket'''. 
** '''Features:''' 
*** '''ICMP handling:''' The responsibility for processing '''ICMP headers''' is completely offloaded from the application. The new socket no longer sends the '''ICMP header''' to the application (unlike raw sockets). Rather, it uses '''IcmpPacketInfoTag''' for the same. 
*** '''New Packet Tag implemented:''' Introduced a new '''IcmpPacketInfoTag''' that stores '''metadata''' about the '''ICMP packet''' received to be sent up to the application. 
** '''Tests:''' Added '''unit tests''' for validating ICMP functionality covering almost all of the '''ICMP types''' for received packet ('''echo reply, destination unreachable, time exceeded, etc.''') 
** '''Ping application:''' Integrated the novel '''ICMP socket''' in the '''Ping application'''. Allowed for the user to choose whether to send packets via '''ICMP socket''' or via '''Raw Sockets'''. 


= Milestones =
* '''Limitations and proposed solutions''' 
** '''SO_REUSEADDR:''' The novel '''ICMP socket''' does not allow for two sockets on the same node to be bound to the same '''identifier''' even if they are bound to different '''IP addresses'''. This can be solved by using a '''map(identifier -> List of ICMP sockets)''' instead of the current implementation '''map(identifier -> ICMP socket)'''. 
** '''Identifier map in Protocol layer:''' The current '''LLD''' of the socket states to store the '''map of used identifiers''' in the '''protocol layer'''. This kind-of pollutes the '''ICMP protocol'''. To solve this, an '''unordered set''' can be stored in the '''IcmpSocketFactory''' object to store all the '''identifiers''' already used for a particular '''node'''.

Latest revision as of 05:28, 31 August 2025

Main Page - Roadmap - Summer Projects - Project Ideas - Developer FAQ - Tools - Related Projects

HOWTOs - Installation - Troubleshooting - User FAQ - Samples - Models - Education - Contributed Code - Papers

Back to GSoC 2025 projects

Project Overview

  • Project Name: ICMP socket and generate/handle ICMP messages (host/net unreachable)
  • Student: Aditya Ruhela
  • Mentors: Tommaso Pecorella and Alberto Gallegos Ramonet
  • Google page:
  • Project Goals: Develop an ICMP socket according to LINUX implementation of ICMP SOCK_DGRAM. Currently, for sending ICMP packets, the application has to use a Raw socket. This results in having the user write all the code for adding the headers, the filtering, etc. The proposed ICMP socket aims to offload all this functionality from the user and provide the user with API's required for sending and receiving packets, filtering etc.
  • Repo: https://gitlab.com/ADI-ROXX/ns-3-dev

Milestones

Phase 1: Fix the fragmentation issue in Raw sockets Merge Request

  • Changes made:
    • Forward assembled packets: In case of raw sockets, forward the packet up to the application after the re-assembly, not before that (existing implementation)
    • Test cases: Wrote the test case for IPv4 and IPv6 Raw sockets that ensure that only a single assembled packet is received. Also, included the test cases for Ping application with fragmentation.

Phase 2: Implementation of the ICMP socket Merge Request

  • Changes
    • ICMP error messages: Integrated support for sending ICMP Destination Unreachable messages from the IP layer upon packet drop.
    • ICMP socket: Implemented a dedicated ICMP socket, the LLD of which is similar to that of the UDP socket.
    • Features:
      • ICMP handling: The responsibility for processing ICMP headers is completely offloaded from the application. The new socket no longer sends the ICMP header to the application (unlike raw sockets). Rather, it uses IcmpPacketInfoTag for the same.
      • New Packet Tag implemented: Introduced a new IcmpPacketInfoTag that stores metadata about the ICMP packet received to be sent up to the application.
    • Tests: Added unit tests for validating ICMP functionality covering almost all of the ICMP types for received packet (echo reply, destination unreachable, time exceeded, etc.)
    • Ping application: Integrated the novel ICMP socket in the Ping application. Allowed for the user to choose whether to send packets via ICMP socket or via Raw Sockets.
  • Limitations and proposed solutions
    • SO_REUSEADDR: The novel ICMP socket does not allow for two sockets on the same node to be bound to the same identifier even if they are bound to different IP addresses. This can be solved by using a map(identifier -> List of ICMP sockets) instead of the current implementation map(identifier -> ICMP socket).
    • Identifier map in Protocol layer: The current LLD of the socket states to store the map of used identifiers in the protocol layer. This kind-of pollutes the ICMP protocol. To solve this, an unordered set can be stored in the IcmpSocketFactory object to store all the identifiers already used for a particular node.