General Notes

Linux bootup sequence

    1. BIOS

      1. performs system integrity checks

      2. loads Master boot loader

    2. Master Boot Record MBR

      1. located in /dev/sda

      2. has info about GRUB

    1. GRUB - Grand unified boot loader

      1. select which kernel you want to load

      2. /boot/grub/grub.conf contains config

    1. Kernel

      1. mounts root file system

      2. executes /sbin/init

      3. init process always has PID of 1

      4. loads initrd - initial RAM disk

    1. Init or SystemD

      1. checks /etc/inittab to decide what to run

      2. Newer kernels run systemd

    1. Run Level programs

      1. /etc/rc.d/

      2. 6 run levels + S start and K kill

Run application via X (centos 7)

  1. yum install xauth

    1. yum install xorg-x11-fonts-Type1

    2. set /etc/ssh/sshd_config

    3. set X11 Forwading yes in /etc/ssh/sshd_config,

    4. X11UseLocalHost no

    5. restart sshd service

    6. touch ~/.Xauthority

    7. xauth generate :0 . trusted

    8. xauth add ${HOST}:0 . $(xxd -l 16 -p /dev/urandom)

    9. xauth list

    10. relogin, ssh -X user@host

    11. check DISPLAY

    12. echo $DISPLAY (should be localhost:10 or localhost:0)

7 Network Layers

    1. Physical - cable, electrons, voltage, (transmission mode: simplex, half duplex, full duplex), network topology defined: bus,mesh,ring. Electrical signaling and raw bit stream.

    2. Datalink - MAC address, node-to-node data transfer

    3. Network - translates logical address to physical machine IP address (one step below UDP/TCP). Systems on different subnets and networks find each other on this layer

    4. Transport - TCP, UDP. Breaks data into frames, checks for data errors in packets

    5. Session - session control for incoming and outgoing packets, opens and closes connections via ports (controlled by applications)

    6. Presentation - data encryption, conversion of data from one type to another (ie, TXT to XML)

    7. Application - individual applications handle how and when they send and receive requests

File/Dir permissions chart

TCP Packet structure

[ ethernet header (MAC) | IP header (src | TCP header | payload | checksum (check corruption) ]


TCP vs UDP

  • TCP is a connection-oriented protocol, whereas UDP is a connectionless protocol.

  • The speed for TCP is slower while the speed of UDP is faster

  • TCP uses handshake protocol like SYN, SYN-ACK, ACK while UDP uses no handshake protocols

  • TCP does error checking and also makes error recovery, on the other hand, UDP performs error checking, but it discards erroneous packets.

  • TCP has acknowledgment segments, but UDP does not have any acknowledgment segment.

  • When we compare TCP vs UDP protocol, TCP is heavy-weight, and UDP is lightweight.



TCP

  • Supports bandwidth-intensive applications that tolerate packet loss

  • Less delay

  • It sends the bulk quantity of packets.

  • Possibility of the Data loss

  • Allows small transaction ( DNS lookup)

  • header size 20 bytes

  • arranges packets in seq order

  • does error check + recovery

  • 3 way handshake




UDP

  • Supports bandwidth-intensive applications that tolerate packet loss

  • Less delay

  • It sends the bulk quantity of packets.

  • Possibility of the Data loss

  • Allows small transaction ( DNS lookup)

  • header size 8 bytes

  • packets are not arranged

  • error check, no recovery

  • no handshake



Kernel Bypass, bypass kernel and NIC to kernel interrupts, resulting in higher throughput and less latency, avoid shared datastructure overheads, no locks