An Interest In:
Web News this Week
- April 19, 2024
- April 18, 2024
- April 17, 2024
- April 16, 2024
- April 15, 2024
- April 14, 2024
- April 13, 2024
Networking
Basic Networking Terms:-
- Collection of devices connected together in one physical location.
- Each device has a unique IP(Internet Protocol) address.
- Devices communicate via these IP addresses.
IP -> Internet Protocol
- 32-bit value.
- 1 bit : 1 or 0.
- 00000000 : 0
- 11111111 : 255
Eg; 172.16.0.0
- IP addresses can range from 0.0.0.0 to 255.255.255.255
Switch
- Sits within the LAN.
- Facilitates the connection between all the devices within the LAN
Gateway -> IP address of Router.
Router
- Sits between LAN & outside networks (WAN: Wide Area Network).
- Connects devices on LAN & WAN.
- Allows networked devices to access the Internet.
Subnet -> Logical subdivision of an IP network.
How to know whether the other device is inside or outside the LAN?
- It knows because of the IP address of the target device.
- Devices in the LAN belong to the same IP address range.
Subnetting -> Process of dividing a network into two or more networks.
IP address range
CIDR*(Classless Inter-Domain Routing)* Block
- Subnet Mask dictates how many bits are fixed.
- 255.255.0.0 -> means that 16 bits are fixed
- 255.255.255.0 -> means that 24 bits are fixed
Any device needs 3 pieces of data for communication:
- IP address
- Subnet
- Gateway
NAT*(Network Address Translation):*
- The IP address range is chosen by an administrator.
- Each device gets a unique IP from that range.
How to make sure that IP addresses don't overlap?
- IP addresses within LAN are not visible to the outside network or internet.
- Your laptop's private IP address is replaced by the router.
Benefits of NAT;
- Security & Protection of devices within LAN.
- Reuse IP addresses.
Limited no. of IPv4 addresses available - 4,294,967,296 public addresses.
Firewall
- A system that prevents unauthorized access from entering a private network.
- Using Firewall Rules you can define, which requests are allowed.
Firewall Rules;
- Which IP address in your network is accessible
- Which IP address can access your server.
- You can, e.g., allow any device to access your server.
- Allows device IP address at the port to be accessed.
- This is also called Port Forwarding
What is a Port?
Port -> every device has a set of ports.
- You can allow specific ports(doors).
- You can allow specific ports(doors) AND specific IP addresses (guests).
- Different Applications listen to specific ports.
Standard Ports for many applications:-
- Port 80 -> Web Servers
- Port 3306 -> MySQL DB
- Port 5432 -> PostgresQL DB
For every application, you need a port!
Each port is unique on a device.
DNS -> Domain Name Service
- Translates domain names to IP addresses.
Why do we use names instead of IP addresses?
- Humans are better at remembering words & names instead of numbers.
Eg; www.facebook.com -> 69.63.176.13 Mapping IP addresses to Names.
How does DNS manage all these IP addresses?
- Domain Names have a hierarchical structure.
Root Domains (there are 13 root domains named from a to m)
Top Level Domain
There are also geographical domains that were added later.
Who manages these names?
Who can keeps track of the availability of names?
This is all regulated by a dedicated organization called Internet Corporation for Assigned Names & Numbers (ICANN).
- Manages the TLD development and architecture of the internet domain space.
- Authorizes Domain Name Registrars, which register & assign domain names.
Each domain name can have a subdomain name with IP address range of domain name
How does the DNS Resolution work?
DNS entries are cached for efficiency
Networking Commands:
ifconfig
-> shows all network details.netstat
-> shows active connection on your machine.ps -aux
-> shows currently running applications on which port they are listening, computer resources they are consuming, etc.nslookup
-> you can get the IP address of any domain name.ping
-> checks whether a service/application is accessible.
These are used to
- Troubleshoot your network
- Of course, there are parameters for all those commands.
Original Link: https://dev.to/kcdchennai/networking-1g41
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To