Firewall is showed in port no 7 and Google search is also showed in port no 7 so I am confused about how exactly ICMP use the port number.

You are watching: Why is it that an icmp packet does not have source and destination port numbers

Regards,Bhushan


*

*

Port numbers are a feature of transport layer protocols such as TCP and UDP. ICMP is really part of the internetworking layer (IP), so that attribute doesn"t exist at that layer.

And yes, I know that ICMP is encapsulated in IP, but it still is considered part of the internetworking layer. That just shows the limitations of the model. To quote from RFC 792:

ICMP, uses the basic support of IP as if it were a higher level protocol, however, ICMP is actually an integral part of IP, and must be implemented by every IP module. .


Share
Improve this answer
Follow
answered Jun 5 "18 at 14:25
*

Ron TrunkRon Trunk
59k44 gold badges5555 silver badges112112 bronze badges
2
Add a comment |
6
ICMP is IP protocol 1, TCP is 6 and UDP is 17. So these are all different protocols with different behaviors.TCP and UDP have Ports, ICMP does not.TCP and UDP have an Echo Service on Port 7, sometimes called TCP-Ping/UDP-Ping, but they have nothing to do with ICMP. Maybe this is your confusion.


Share
Improve this answer
Follow
edited Nov 1 "18 at 19:04
*

Banghua Zhao
28222 silver badges1414 bronze badges
answered Jun 5 "18 at 14:03
*

Winnie TiggerWinnie Tigger
26611 silver badge44 bronze badges
Add a comment |
3
TCP and UDP are transport protocols that use port numbers to multiplex their use between applications or processes.

This way, your browser using HTTP over TCP can e.g. connect multiple times to the exact same web server. While the destination port is the same (default for HTTP: 80), different source ports are used for each socket connection.

See more: Explain Why China And Southwest Asia Are Major Destinations For Migrants

In the same way, different applications can use the same multiplexing, of course. On the server side there can be different services on different TCP ports - HTTP on 80, FTP on 21, SMTP on 25, and so on. Or - using non-standard ports - even different web servers on ports 80 and 8000, for instance.

Without ports, there could be only a single TCP connection between any two hosts, or a single TCP service running on a server. (Likewise with UDP or any other transport protocol.)

ICMP is not a transport protocol but a part of the IP protocol. It is used for signaling between hosts. Messages that can be transmitted include

Destination unreachable (a router signals that it"s unable to forward towards the destination, a host rejects a packet, or similar)Redirect message (a router wants the source to use another gateway)Time exceeded (a packet has exceeded its lifetime/hop count and was dropped)Echo request / Echo reply (used byping)