anitsh / til

Today I Learn (til) - Github `Issues` used as daily learning management system for taking notes and storing resource links.
https://anitshrestha.com.np
MIT License
78 stars 11 forks source link

Network, OSI Network Model #93

Open anitsh opened 4 years ago

anitsh commented 4 years ago

Network

The Open Systems Interconnection (OSI) Network Model

image

image

image

An IP Header

What is zero configuration networking? Zero configuration networking allows you to automatically create a network of devices without having to manually configure a DHCP server, DNS services, or network settings for each device that you want to connect to that network. Avahi is an implementation of zero configuration networking that you use with Linux operating systems. Avahi is installed by default on most Linux systems and can run multicast DNS and DNS service discovery. Bonjour is a zero configuration networking application from Apple. #357

Network Qualities

Latency

Latency is the time delay between the cause and the effect of some physical change in the system being observed.

Network latency in a packet-switched network is measured as either one-way (the time from the source sending a packet to the destination receiving it), or round-trip delay time (the one-way latency from source to destination plus the one-way latency from the destination back to the source). Round-trip latency is more often quoted, because it can be measured from a single point. Note that round trip latency excludes the amount of time that a destination system spends processing the packet.

Many software platforms provide a service called ping that can be used to measure round-trip latency. Ping uses the Internet Control Message Protocol (ICMP) echo request which causes the recipient to send the received packet as an immediate response, thus it provides a rough way of measuring round-trip delay time. Ping cannot perform accurate measurements, principally because ICMP is intended only for diagnostic or control purposes, and differs from real communication protocols such as TCP. Furthermore, routers and internet service providers might apply different traffic shaping policies to different protocols. For more accurate measurements it is better to use specific software, for example: hping, Netperf or Iperf.

However, in a non-trivial network, a typical packet will be forwarded over multiple links and gateways, each of which will not begin to forward the packet until it has been completely received. In such a network, the minimal latency is the sum of the transmission delay of each link, plus the forwarding latency of each gateway. In practice, minimal latency also includes queuing and processing delays. Queuing delay occurs when a gateway receives multiple packets from different sources heading towards the same destination. Since typically only one packet can be transmitted at a time, some of the packets must queue for transmission, incurring additional delay. Processing delays are incurred while a gateway determines what to do with a newly received packet. Bufferbloat can also cause increased latency that is an order of magnitude or more. The combination of propagation, serialization, queuing, and processing delays often produces a complex and variable network latency profile. Latency limits total throughput in reliable two-way communication systems as described by the bandwidth-delay product.

Throughput

Network throughput is the rate of successful message delivery over a communication channel such as Ethernet or packet radio. The data these messages belong to may be delivered over a physical or logical link, or it can pass through a certain network node. Throughput is usually measured in bits per second (bit/s or bps), and sometimes in data packets per second (p/s or pps) or data packets per time slot. The system throughput or aggregate throughput is the sum of the data rates that are delivered to all terminals in a network.

Tarpit

A tarpit is a service on a computer system (usually a server) that purposely delays incoming connections. The technique was developed as a defense against a computer worm, and the idea is that network abuses such as spamming or broad scanning are less effective, and therefore less attractive, if they take too long. The concept is analogous with a tar pit, in which animals can get bogged down and slowly sink under the surface, like in a swamp.

Resource

anitsh commented 3 years ago

Transmission Control Protocol (TCP)

TLS / SSL

HTTP / HTTP2 / HTTPS

WebSocket

NAT vs Proxy vs Router

Serial Number Arithmetic

anitsh commented 3 years ago

Tools and Commands

image Comm­and Desc­rip­tion
watch ss -tp Network Connec­tions
netstat -ant TCP connec­tions
netstat -anu UDP Connec­tions
netstat -tulpn Connec­tions with PIDs
lsof -i Establ­ished Connec­tions
smb:/­/<I­P>/­<SH­ARE­NAM­E> Access Windows SMB Share
share <US­ERN­AME> c$ Mount Windows Share
ifconfig <IN­TER­FAC­E> <IP­/CI­DR> Set IP and netmask
ifconfig eth0:1 <IP­/CI­DR> Set virtual interface
route add default gw <IP­> Set Default Gateway
ifconfig <IN­TER­FAC­E> mtu <SI­ZE> Change MTU size
export MAC=<M­ACA­DDR­ESS­> Change MAC Address
ifconfig int hw ether <MA­CAD­DRE­SS> Change MAC Address
dig -x <IP­> Domain Lookup IP
host <IP­> Domain Lookup IP
dig@<­IP> <DO­MAI­N> -t AXFR DNS Zone Transfer
host -l <DO­MAI­N> <NA­MES­ERV­ER> DNS Zone Transfer
echo "­1" > /proc/­sys­/ne­t/i­pv4/ip forward Enable IP Forwarding
echo <"NA­MES­ERV­ER"> > /etc/r­eso­lv.c­onf Add DNS Server
ss -p See what apps are consuming internet

ss

Utility to investigate sockets. Alternative to netstat which is by default not installed in Ubuntu. ss is. ss -lntu -l – prints only listening sockets -n – shows port number -t – enables listing of tcp ports -u – enables listing of udp ports

Resource