Skip to content
Snippets Groups Projects
10_network_and_ssh.Rmd 23.84 KiB
title: SSH
author: "Laurent Modolo"
output:
  rmdformats::downcute:
    self_contain: true
    use_bookdown: true
    default_style: "light"
    lightbox: true
    css: "./www/style_Rmd.css"

if (!require("fontawesome")) {
  install.packages("fontawesome")
}
if (!require("klippy")) {
  install.packages("remotes")
  remotes::install_github("rlesur/klippy")
}
library(fontawesome)
knitr::opts_chunk$set(echo = TRUE)
knitr::opts_chunk$set(comment = NA)
klippy::klippy(
  position = c("top", "right"),
  color = "white",
  tooltip_message = "Click to copy",
  tooltip_success = "Copied !"
)

cc_by_sa

Objective: Learn basics of ssh connection in GNU/Linux

In the previous section, we have seen how to run scripts and complex commands on your computer. In this session we are going to learn to do that over the network.

Most of the content from this session are from wikipedia.org

Network

First before talking about how to communicate over a network, we need to define what is a network in computational science. We can distinguish between two types of network, circuit switching networks and packet switching networks.

circuit switching

Circuit switching is the historical telephonic network architecture. When device A wants to communicate with device B, it has to establish a connection over the network. In a circuit switching network, the connections between a chain of nodes (hopefully the shortest chain) are established and fixed. Device A connects to the closest node and ask connection to Device B, this node will do the same thing to the closest node to Device B, so on and so forth until the connection reach Device B.

If you try to call someone, who is already in a phone conversation, the line will be occupied.

http://www.tcpipguide.com/free/diagrams/funcircuitswitching.png

packet switching

Packet switching is a method of grouping data over the network into packets. Each packet has a header and a payload. The header data can be read by each node to direct the packet to its destination. The header data also inform the Host 2 of the packets order. The payload contains the data that we want to transmit over the network. In packet switching, the network bandwidth is not pre-allocated like in circuit switching. Each packet is called a datagram.

“A self-contained, independent entity of data carrying sufficient information to be routed from the source to the destination computer without reliance on earlier exchanges between this source and destination computer and the transporting network.”

https://en.wikipedia.org/wiki/Packet_switching#/media/File:Packet_Switching.gif

In a packet switching network when you send a flux of data (video, sound, etc.), you have the illusion of continuity like for process switching handled by the scheduler.

Internet Protocol (IP)

The Internet Protocol (IP) is the principal communications protocol in the Internet protocol suite for relaying datagrams across network boundaries. Its routing function enables internetworking, and essentially establishes the Internet.

IP has the task of delivering packets from the source host to the destination host solely based on the IP addresses in the packet headers. For this purpose, IP defines packet structures that encapsulate the data to be delivered. It also defines addressing methods.