Posts

Showing posts with the label Networking

ip_classifier.py for ipv32

Written simple program to find the class for an ip address of 32bit version #!/usr/bin/python import sys, getopt def __help(): sys.stderr.write('\n Usage: \n ip_classifier.py -h \n ip_classifier.py --help \n ip_classifier.py -i 128.12.14.23 \n ip_classifier.py --ipv4=128.12.14.23 \n ') sys.exit() def __input_validator(check): if len(check) <> 0: check = list(check) c = 0; n = 0 for v in check: if v in ['.','1','2','3','4','5','6','7','8','9','0']: n += 1 test = True if v is '.': c += 1 else: test = False break if test and c < 4 and n > 6: return check else: sys.stderr.write('**** Enter correct ip address **** \n') __help() def __validator(ip): if ip in range(0,256): return True else: sys.stderr.write('**** Enter correct ip address **** \n') __help() def __class_finder(ip, class_ip, bin_

OSI Layer

Image

Subnetting Basics - Self Learn

Image
To understand IP address resolution, you need to understand how to decode the IP address and extract the two main identifiers: A network ID (the network bits) A host ID (the bits the system administrator controls locally when assigning IP addresses) Network ID is used to identify the number of  networks and Host ID is used to identify the number of hosts on the local-area network. For now, just keep in mind a few subnetting basics: A  subnet  mask — or  subnet  address — is used by routers to assist in determining the network portion of an IP address from the host portion. The  subnet  mask is a 32-bit value just like the IP address. The binary 1 bits correspond to the network and  subnet  portions of the address. The 0 bits are host representatives. Three standard masks exist for Class A, B, and C networks: Standard Class A   subnet  mask: 255.0.0.0 Standard Class B   subnet  mask: 255.255.0.0 Standard Class C   subnet  mask: 255.255.255.0

Network Addressing IPv4 - Self Learn

Image
Network Addressing: Each device on a TCP/IP (IPv4) network uses a unique 4-byte, or 32-bit, decimal IP address for communication and is composed of two distinct parts: a  network address  and a  host address. Each 8 byte is called octet. Example: 172.168.16.100 172 -> belongs class B 172.168. is the network address 16.100 is the host address Routing is done based on the network address. Each octet can have the value between 0-255. Classes of IP Addresses Two of the main ones are designated for the  default route  and  loopback address. The default route address is represented as 0.0.0.0 and is used to simplify the routing information that IP uses. Any route lookup failure defaults back to this route. The loopback address space is 127.0.0.0 and is used for testing and treating a local host as if it were remote to the network.  Class A (0–127): '0'  Class B (128–191):   '10' Class C (192–223):'110' Cl

Networking Basics - Self Study

Image
A common connection point for the devices  like computer, smartphones in the network  are due to the hubs, switches, repeaters and routers. Networking Components: Hub has multiple ports. When the frame arrives at one port, it broadcast the same message to all other ports. Hub does not check the destination address, it simply broadcast to all available ports. Hubs are less intelligent as it works on physical layer (L1) of OSI model it does not know the MAC address of the ports connected to the network. It lacks in security, so the attacker can sniff the neighbor packets. (Hubs are outdated) Hub can create lot of network traffic and lead to poor response times. Repeater is also similar to hub, but it is used to amplifies the input the signal. When input signal has both desired signal and noise along with it. Repeater regenerates the desired signal and noise signal will be eliminated. Repeater can be used in the situation where there is a long distance in transmissio