2

Ping works in the internet layer, but when I ping an IP address in my terminal, is ping in the application layer? If it is, how does the application pass transport layer?

If it is not, can I say those applications that use protocols in the application layer (SSH, DHCP, etc.) and pass the transport layer can be in the application layer not all applications?

3
  • Ping is an application that uses ICMP, which is used like a transport-layer protocol, but is really an integral part of IP.
    – Ron Maupin
    Apr 7, 2017 at 17:55
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide and accept your own answer.
    – Ron Maupin
    Feb 19, 2018 at 5:43

2 Answers 2

5

I'll start with the oft-repeated caveat (at least by me, anyway) that things don't fit neatly into the OSI model.

"Ping" is the name of an application that generates ICMP echo request packets and receives echo reply packets. ICMP doesn't neatly fit into the OSI or TCP/IP model, so you can call it layer 3 or layer 3.5, depending on your point of view.

6
  • is it means the ping application is not in application layer? it use directly internet layer
    – Sinoosh
    Apr 7, 2017 at 18:39
  • 1
    Ping is a program. Don't confuse it with the ICMP echo packets. You don't send a ping --you run the ping application that generates an ICMP packet.
    – Ron Trunk
    Apr 7, 2017 at 19:09
  • i know that ping create icmp request and sends it and gets icmp reply.my question is about ping aplication not how to use ICMP.is this apllication run in the application layer?
    – Sinoosh
    Apr 7, 2017 at 20:04
  • All applications run in the application layer- by definition.
    – Ron Trunk
    Apr 7, 2017 at 20:59
  • So , Typically "ping" is implemented using "raw sockets" isn't it?
    – Sinoosh
    Apr 8, 2017 at 6:33
1

Typically "ping" is implemented using "raw sockets". These let applications bypass the transport layer and generate/interpret packets themselves.

Raw sockets have security implications and hence there are often restrictions on them beyond those applied to regular sockets. Traditionally on unix-like systems ping was "suid" to allow it to use raw sockects through recent linux distros often use "capabilities" instead. I dunno what the picture looks like on other platforms.

2
  • is there an application use tcp/ip stack but not be in application layer?
    – Sinoosh
    Apr 7, 2017 at 17:48
  • do yo have refernce for showing that ping use raw socket?
    – Sinoosh
    Apr 7, 2017 at 17:53

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.