Computer Networks - WordPress.com · CPSC$441$(Computer$Networks),$Winter$2016$ Public$VM...

17
Computer Networks Tutorial1: Rapid Access Cloud (RAC) Account and Network Setup CPSC 441, Winter 2016 Department of Computer Science, University of Calgary

Transcript of Computer Networks - WordPress.com · CPSC$441$(Computer$Networks),$Winter$2016$ Public$VM...

Page 1: Computer Networks - WordPress.com · CPSC$441$(Computer$Networks),$Winter$2016$ Public$VM Key$Name:$cpsc441Iremote$ Public$IP:$199.116.235.169$ Exercise: Create network of VMs 3 You$

CPSC  441  (Computer  Networks),  Winter  2016  CPSC  441  (Computer  Networks),  Winter  2016  

Computer Networks

Tutorial1: Rapid Access Cloud (RAC) Account and Network Setup

CPSC 441, Winter 2016

Department of Computer Science, University of Calgary

Page 2: Computer Networks - WordPress.com · CPSC$441$(Computer$Networks),$Winter$2016$ Public$VM Key$Name:$cpsc441Iremote$ Public$IP:$199.116.235.169$ Exercise: Create network of VMs 3 You$

CPSC  441  (Computer  Networks),  Winter  2016  CPSC  441  (Computer  Networks),  Winter  2016  

Outline !  Cloud  overview  

!  Setup  an  RAC  (Rapid  Access  Cloud)  account  

!  Create  an  instance  (Virtual  Machine)  in  RAC  

! Access  your  RAC  

!  Exercise  (Assignment  0)  

2  

Page 3: Computer Networks - WordPress.com · CPSC$441$(Computer$Networks),$Winter$2016$ Public$VM Key$Name:$cpsc441Iremote$ Public$IP:$199.116.235.169$ Exercise: Create network of VMs 3 You$

CPSC  441  (Computer  Networks),  Winter  2016  CPSC  441  (Computer  Networks),  Winter  2016  

Public  VM  Key  Name:  cpsc441-­‐remote  Public  IP:  199.116.235.169  

Exercise: Create network of VMs

3  

RAC  You  Key  pair:  cpsc441-­‐remote  

1  

10.2.0.173  

2  

4  

3  

5  

Private  VMs  Key  Name:  cpsc441-­‐local  

10.2.0.174  

10.2.1.122  

10.2.1.124  

10.2.1.123  

!  Connect  to  the  public  VM  (1)  and  thereaQer  to  reach  the  private  VMs  (2-­‐5).  

!  The  public  VM  has  two  IP  addresses  (public  and  private)  and  two  key  paris  (cpsc441-remote  for  remote  access  and  cpsc441-loscal for  accessing  the  private  VMs.  

Page 4: Computer Networks - WordPress.com · CPSC$441$(Computer$Networks),$Winter$2016$ Public$VM Key$Name:$cpsc441Iremote$ Public$IP:$199.116.235.169$ Exercise: Create network of VMs 3 You$

CPSC  441  (Computer  Networks),  Winter  2016  CPSC  441  (Computer  Networks),  Winter  2016  

Important to Remember !  Set  up  all  instances  in  the  Edmonton  region  !  You  can  only  access  1  instance  remotely    !  Only  1  public  IP  is  available  !  All  instances  have  a  private  IP  !  Other  instances  can  be  accessed  using  private  IPs  once  you  login  to  the  instance  which  has  public  IP  

4  

Page 5: Computer Networks - WordPress.com · CPSC$441$(Computer$Networks),$Winter$2016$ Public$VM Key$Name:$cpsc441Iremote$ Public$IP:$199.116.235.169$ Exercise: Create network of VMs 3 You$

CPSC  441  (Computer  Networks),  Winter  2016  CPSC  441  (Computer  Networks),  Winter  2016  

Creating more instances (VMs) !  Example  of  creaXng  all  four  instances  at  once  is  explained  

5  

Go  to  “instances”  

Page 6: Computer Networks - WordPress.com · CPSC$441$(Computer$Networks),$Winter$2016$ Public$VM Key$Name:$cpsc441Iremote$ Public$IP:$199.116.235.169$ Exercise: Create network of VMs 3 You$

CPSC  441  (Computer  Networks),  Winter  2016  CPSC  441  (Computer  Networks),  Winter  2016  

Creating more instances (VMs)

6  

Click  “Launch  Instances”  

!  Launch  your  instances  

Page 7: Computer Networks - WordPress.com · CPSC$441$(Computer$Networks),$Winter$2016$ Public$VM Key$Name:$cpsc441Iremote$ Public$IP:$199.116.235.169$ Exercise: Create network of VMs 3 You$

CPSC  441  (Computer  Networks),  Winter  2016  CPSC  441  (Computer  Networks),  Winter  2016  

Configure the new instance

7  

Step-­‐A  (Enter  as  follows):  Availability  zone:  nova  Instance  Name:  cpsc441_2  Flavor:  m1.micro  Instance  Count:  4  Instance  Boot  Source:  Boot            from  image  Image  Name:  Ubuntu  14.04  

Step-­‐B:  Click  “Access  &  Security”  

cybera-­‐instance-­‐3  

Page 8: Computer Networks - WordPress.com · CPSC$441$(Computer$Networks),$Winter$2016$ Public$VM Key$Name:$cpsc441Iremote$ Public$IP:$199.116.235.169$ Exercise: Create network of VMs 3 You$

CPSC  441  (Computer  Networks),  Winter  2016  CPSC  441  (Computer  Networks),  Winter  2016  

Configure the new instance

8  

Click  “+”  to  add  a  key  pair  

Page 9: Computer Networks - WordPress.com · CPSC$441$(Computer$Networks),$Winter$2016$ Public$VM Key$Name:$cpsc441Iremote$ Public$IP:$199.116.235.169$ Exercise: Create network of VMs 3 You$

CPSC  441  (Computer  Networks),  Winter  2016  CPSC  441  (Computer  Networks),  Winter  2016  

Configure the new instance !  Generate  public/private  key  pair  to  enable  access  between  VM  with  public  IP  and  the  new  VM  being  created  

!  Launch  a  terminal  in  the  VM  with  public  IP  !  Do  the  following:  !  Create  ‘key’  files:  ssh-­‐keygen  -­‐t  rsa  -­‐f  cpsc441-­‐local.key          (You  can  leave  the  “passphrase”  as  empty)  !  Two  files  will  get  created  in  the  folder:  a  private  key  file  “cpsc441-­‐local.key”  and  a  public  key  file  “cpsc441-­‐local.key.pub”.  !  You  will  need  these  files  to  connect  to  other  virtual  machines  (with  private  IPs)  

!  Use  “cat”  command  to  see  the  content  of  the  public  key  file:  cat  cpsc441-­‐local.key.pub  

!  Copy  the  content  of  this  file  

9  

Page 10: Computer Networks - WordPress.com · CPSC$441$(Computer$Networks),$Winter$2016$ Public$VM Key$Name:$cpsc441Iremote$ Public$IP:$199.116.235.169$ Exercise: Create network of VMs 3 You$

CPSC  441  (Computer  Networks),  Winter  2016  CPSC  441  (Computer  Networks),  Winter  2016  

Configure the new instance

10  

Key  pair  name:  cpsc441-­‐local  

Paste  the  content  of  public  key  here  

Import  the  key  

Page 11: Computer Networks - WordPress.com · CPSC$441$(Computer$Networks),$Winter$2016$ Public$VM Key$Name:$cpsc441Iremote$ Public$IP:$199.116.235.169$ Exercise: Create network of VMs 3 You$

CPSC  441  (Computer  Networks),  Winter  2016  CPSC  441  (Computer  Networks),  Winter  2016  

Access the new instances !  Connect  to  the  public  VM  !  ssh  –i  cpsc441-­‐remote.key  ubuntu@<public-­‐ip-­‐address>  

!  Connect  to  the  private  VMs:  !  On  the  public  VM,  do:  !  ssh  –i  cpsc441-­‐local.key  ubuntu@<private-­‐ip-­‐address>  !  Above  command  enables  you  to  login  to  the  instance  with  <private-­‐ip-­‐address>  

Note:  You  can  get  informaBon  about  public/private  IP  addresses                                  from  the  RAC  account  page  

11  

Page 12: Computer Networks - WordPress.com · CPSC$441$(Computer$Networks),$Winter$2016$ Public$VM Key$Name:$cpsc441Iremote$ Public$IP:$199.116.235.169$ Exercise: Create network of VMs 3 You$

CPSC  441  (Computer  Networks),  Winter  2016  CPSC  441  (Computer  Networks),  Winter  2016  

Ping !  It  sends  ICMP  echo  requests  to  network  hosts  

!  Typically  used  to  check  whether  a  host  is  reachable  over  the  network  

! Also  provides  Round  Trip  Time  (RTT)  informaXon  (see  sample  ping  result  below)  

12  Minimum  RTT  observed    in  milliseconds    

Page 13: Computer Networks - WordPress.com · CPSC$441$(Computer$Networks),$Winter$2016$ Public$VM Key$Name:$cpsc441Iremote$ Public$IP:$199.116.235.169$ Exercise: Create network of VMs 3 You$

CPSC  441  (Computer  Networks),  Winter  2016  CPSC  441  (Computer  Networks),  Winter  2016  

Assignment 0 !  Use  the  ping  tool  to  discover  your  private  network  of  five  VMs.  !  According  to  the  output  of  the  ping  tool,  complete  the  network  diagram  (on  slide  56)  by  filling  out  the  IP  addresses  and  the  link  delay  between  each  pair  of  VMs.  

!  You  may  do  this  manually,  or  simply  run  the  scripts  provided  on  the  public  VM.  

!  Scripts:  !  Discover  –  ping  each  of  the  IP  addresses  listed  in  the  host-­‐list  file.

!  Deploy  –  copy  the  host-­‐list  file  and  the  discover  script  to  each  private  VM.  

!  Run  –  remotely  execute  the  discover  script  on  all  five  VMs  !  Collect  –  consolidate  the  results  of  the  discover  script  (output  of  the  ping  tool)  from  all  machines  into  a  single  file  named  results.txt.  

13  

Page 14: Computer Networks - WordPress.com · CPSC$441$(Computer$Networks),$Winter$2016$ Public$VM Key$Name:$cpsc441Iremote$ Public$IP:$199.116.235.169$ Exercise: Create network of VMs 3 You$

CPSC  441  (Computer  Networks),  Winter  2016  CPSC  441  (Computer  Networks),  Winter  2016  

Help for Assignment - 0

Do  the  following  steps  on  the  public  VM  !  List  private  IP  addresses  of  all  VMs  in  the  host-­‐list  file  !  “host-­‐list”  file  contains  private  IP  addresses  of  all  the  VMs,  one  IP  per  line  with  no  blank  lines  (see  the  provided  host-­‐list  file  for  an  example)  

!  Run  the  Deploy  script  to  upload  the  host-­‐list  file  and  the  discover  script  to  each  private  VM.  

!  Run  the  Run  script  to  execute  the  discover  script  on  all  five  VMs  !  Make  sure  that  the  private  key  file  name  in  the  script  is  correct  (including  the  path)  

!  Allow  3  to  4  minutes  for  “discover”  script  to  complete  in  each  instance  !  Run  the  Collect  script  to  consolidate  the  results  of  the  discover  script  (output  of  the  ping  tool)  from  all  machines  into  a  single  file  named  results.txt  on  the  public  VM.  !  A  sample  consolidated  result  file  is  provided  for  reference  

!  Print  and  submit  results.txt  and  the  completed  network  diagram  

14  

Disclaimer:  The  scripts  are  provided  to  help  you  in  compleIng  the  assignment.  It  may  not  be  opImal.    You  may  choose  to  ignore  it  and  develop  your  own  scripts.  

Page 15: Computer Networks - WordPress.com · CPSC$441$(Computer$Networks),$Winter$2016$ Public$VM Key$Name:$cpsc441Iremote$ Public$IP:$199.116.235.169$ Exercise: Create network of VMs 3 You$

CPSC  441  (Computer  Networks),  Winter  2016  CPSC  441  (Computer  Networks),  Winter  2016  

Assignment 0

15  

RAC  Your  machine  

1  Private  IP  address:    ______________  

Public  IP  address:    ___________  

2  

IP:  _____________  

3  

IP:  _____________  

4  

IP:  _____________  

5   IP:  _____________  

Page 16: Computer Networks - WordPress.com · CPSC$441$(Computer$Networks),$Winter$2016$ Public$VM Key$Name:$cpsc441Iremote$ Public$IP:$199.116.235.169$ Exercise: Create network of VMs 3 You$

Assignment 0

RAC  Your  machine  

1  Private  IP  address:    ______________  

Public  IP  address:    ___________  

2  

IP:  _____________  

3  

IP:  _____________  

4  

IP:  _____________  

5   IP:  _____________  

Page 17: Computer Networks - WordPress.com · CPSC$441$(Computer$Networks),$Winter$2016$ Public$VM Key$Name:$cpsc441Iremote$ Public$IP:$199.116.235.169$ Exercise: Create network of VMs 3 You$

CPSC  441  (Computer  Networks),  Winter  2016  CPSC  441  (Computer  Networks),  Winter  2016  

Questions?

17