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.
Regards, Bhushan
Network Engineering Stack Exchange is a question and answer site for network engineers. It only takes a minute to sign up.
Sign up to join this communityFirewall 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.
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. [emphasis added].
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.
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.
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
ping
)Port numbers are transport-layer addresses used by some transport protocols. The purpose of the transport addresses (ports) is to allow multiple processes to simultaneously use a transport protocol, and the transport protocol can deliver the correct data to the correct process out of multiple processes using it.
The port numbers are also per protocol. For example, TCP and UDP use port numbers for addressing, but TCP port 12345
is not UDP port 12345
. Only one process at a time can bind to TCP port 12345
, but one process can bind to TCP port 12345
at the same time another process binds to UDP port 12345
.
ICMP doesn't have "port numbers" per-se, but it does have things that are similar to port numbers, and in some cases the ICMP payload will contain port numbers for other layer 4 protocols.
All ICMP packets have a "type", this identifies the type of the ICMP package. The types of ICMP packet can be broadly divided into four categories:
For errors the start of the original datagram that caused the error is included in the error packet, to allow the sender to match the error to the connection (or psuedo-connection) that caused it. If the original packet was a TCP or UDP packet the error packet will contain the port numbers associated with the original packet.
Query messages come together with a corresponding Response message. The type of query can be seen as analogous to the well-known port on a server while the identifier field can be seen as analogous to the random port chosen by a client. User interfaces for firewalls and NATs may well use the "port" fields in the UI to represent these numbers.
Having said that ICMP type number 7 is unassigned and it would seem unlikely for a client to randomly select 7 as it's request ID, so i'm not sure what your firewall is showing.
ICMP is a protocol that is designed specifically for diagnostic purposes and ping is nothing but a ICMP echo request and echo reply that's why there is no concept of port numbers in ICMP.