Wednesday 11 September 2019

ping vs curl, route two subnets,

Ping uses ICMP, no port #
Curl uses TCP
https://networkengineering.stackexchange.com/questions/37896/ping-port-number


ICMP VS TCP:

 ICMP is a control protocol, meaning that it designed to not carry application data, but rather information about the status of the network itself. The best known example of ICMP in practice is the ping utility, that uses ICMP to probe remote hosts for responsiveness and overall round-trip time of the probe messages.

Both Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) are transportation protocols, they are used to pass the actual data. The main difference between TCP and UDP is that TCP is a connection oriented protocol, it guarantees that all sent packets will reach the destination in the correct order.

UDP, on the other hand, is a connection-less protocol. Communication is datagram oriented, so the integrity is guaranteed only on the single datagram. Datagrams reach destination and can arrive out of order or don't arrive at all. It's generally used for real time communication, where a little percentage of packet loss rate is preferable to the overhead of a TCP connection.

https://superuser.com/questions/1044361/why-icmp-is-different-that-tcp-and-udp



Routing table must be modified in router to add a route from one subnet to the other subnet, in case there are two routers:(CISCO ROUTER EXAMPLE)
Suppose we have two routers connected to each other with FastEthernet0/0:

R1 <--------> R2



R1's IP address is 192.168.1.1/24, and R2's IP address is 10.0.0.1/24.



R1#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

R1(config)#int fa0/0

R1(config-if)#ip addr 192.168.1.1 255.255.255.0

R1(config-if)#no shut

R1(config-if)#

*Mar  1 00:01:48.155: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up

*Mar  1 00:01:49.155: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

R1(config-if)#exit

R1(config)#ip route 10.0.0.0 255.0.0.0 fa0/0

R1(config)#end

R1#

*Mar  1 00:02:24.139: %SYS-5-CONFIG_I: Configured from console by console

R1#



R2#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

R2(config)#int fa0/0

R2(config-if)#ip addr 10.0.0.1 255.255.255.0

R2(config-if)#no shut

R2(config-if)#

*Mar  1 00:03:51.971: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up

*Mar  1 00:03:52.971: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

R2(config-if)#exit

R2(config)#ip route 192.168.1.0 255.255.255.0 fa0/0

R2(config)#end

R2#

*Mar  1 00:04:26.463: %SYS-5-CONFIG_I: Configured from console by console

R2#



R2#ping 192.168.1.1

https://learningnetwork.cisco.com/thread/28157



Routing table:
ubuntu command : route -n
destination: the destination ip
gateway: whether to use gateway or not



Port forwarding is to add an entry in the port fowarding table of router so that the public port of router is forwarded to a subnet ip port

No comments:

Post a Comment