Showing posts with label socket. Show all posts
Showing posts with label socket. Show all posts

Sunday, August 24, 2014

PING SOCKET

PING SOCKET


Ping is a program using a raw ICMP socket the program is presented with a copy of all incoming ICMP messages .
There are three commonly encountered types of sockets: stream, datagram, and raw.
TCP uses the stream type and UDP uses the datagram type.
Raw sockets are used by any application that needs to interact directly with
IP, bypassing TCP and UDP in doing so.

ICMP is a necessary component of any TCP/IP implementation. It does not exist to provide information to the higher-layer protocols (like TCP and UDP) so that they may be more reliable.

ICMP protocol is in fact an Internet layer protocol (Layer 3) and is an integral part of the IP protocol suite.
*****************************
it doesn't necessarily mean that only layer 3 devices like router can work with IP but two PCs directly connected with each other can also communicate based on IP and generate messages. the main responsibility of layer 3 device is to forward your packet to other networks were not reachable within your broadcast domain.
****************************
That's the management IP, used to configure and manage a "managed" switch, without this management IP, you can only configure it through the console port or any other ports. When u ping from the switch, it uses its management IP as src IP, that's why you get the respond even though it's not L3 switch. L2 only means it have functions for packet processing up to L2 e.g. MAC ACL, but you can't do things like IP ACL on L2 switch.

switches r of 2 types manageble(l3) ,unmanageble(l2)..................manageble switch .has al functions of router except routing

Wrong. Even my lowly 1900 switch is both L2 and manageable





Friday, August 22, 2014

Port & Socket numbers

Port & Socket numbers


A port number is a number that identifies different services that run on a PC or device using TCP or UDP (layer 4), while a socket number is an IP address with the port number included: eg. 192.168.0.10:21

Port numbers are assigned by the IANA (Internet Assigned Numbers Authority)

There a 3 different types of port numbers :
Well known Ports (1 - 1023) - Used for common services such as FTP, HTTP, Telnet, DHCP.
Registered Ports (1024 - 49151) - Used for services that are not as commonly used that they warrant a well known port number. Eg. WAP, MS SQL, World of Warcraft.
Private/Dynamic Ports (49152 - 65535) - Ports that can be used by anyone for any purpose.

You can view ports that are currently being used on your PC by typing 'netstat' into the DOS prompt (as seen below a after colon in private/public address).

What is a socket?
The combination of a source IP address and port number or a destination IP address and port number
the combination of the source and destination sequence numbers and port numbers
the combination of the source and destination sequence and acknowledgment numbers
the combination of the source and destination IP address and source and destination Ethernet address


A TCP socket is an endpoint instance defined by an IP address and a port in the context of either a particular TCP connection or the listening state.
A port is a virtualisation identifier defining a service endpoint (as distinct from a service instance endpoint aka session identifier).
A TCP socket is not a connection, it is the endpoint of a specific connection.
There can be concurrent connections to a service endpoint, because a connection is identified by both its local and remote endpoints, allowing traffic to be routed to a specific service instance.