2

Can we send raw IP packets over UDP?

What are raw IP Packets?

UDP is a connectionless and unreliable protocol, is it?

3
  • 1
    What's the problem you're trying to solve?
    – Teun Vink
    Commented Feb 9, 2016 at 16:45
  • I am learning the protocols
    – jht
    Commented Feb 9, 2016 at 17:06
  • 3
    I'd suggest reading a bit more about the OSI Model, and how a packet travels across a network. The two protocols operate at different layers: IP, a Layer 3 protocol, serves the purpose of end to end delivery, while UDP, a Layer 4 protocol, serves the purpose of service to service delivery. UDP can't get a packet to another host, nor can IP get a packet to an application.
    – Eddie
    Commented Feb 10, 2016 at 7:46

3 Answers 3

2

IP packets are layer 3. UDP is layer 4. That means that UDP packets are encapsulated inside IP packets, not the other way around.

Now, it is possible to tunnel IP packets, in which case you would have IP inside UDP inside another IP, but that is a special case. For learning about the protocols, you can ignore that for now

8
  • So does it mean we can send raw IP packets over UDP ?
    – jht
    Commented Feb 9, 2016 at 18:04
  • 3
    Technically, you can put anything you want in a UDP packet. But to send UDP, you need to encapsulate it in IP, so it would be IP in UDP in IP. Does that make sense?
    – Ron Trunk
    Commented Feb 9, 2016 at 18:07
  • 2
    I think you need to study the TCP/IP model a little more, specifically the transport layer. Understand what functions it provides. Yes, you can send information directly in IP, but you lose the functionality the the transport layer provides.
    – Ron Trunk
    Commented Feb 9, 2016 at 20:21
  • 2
    That's not quite correct. You can put data directly in IP. Many (now obsolete products) did just that. IP has a payload and doesn't care what's in it.
    – Ron Trunk
    Commented Feb 10, 2016 at 12:04
  • 2
    Also, some well-known protocols, like OSPF, don't use tcp/udp.
    – Ron Trunk
    Commented Feb 10, 2016 at 12:05
0

Yes you can. The question is what computer language do you intend on using? There are traditional server-side languages such as Python as well as client side languages such as JavaScript. There's also linux bash commands (available on Windows via cygwin).

sendip -p ipv4 -is 192.168.1.81 -p udp -us 5070 -ud 5060 -d "Hello" -v 192.168.1.81

See Sending UDP packets from the command line

0

Yes, it's called Foo over UDP on Linux.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.