Multi-routing the '.Net' Gigax, Kevin Edward Torres, Francisco Javier

Slides:



Advertisements
Similar presentations
Umut Girit  One of the core members of the Internet Protocol Suite, the set of network protocols used for the Internet. With UDP, computer.
Advertisements

CCNA – Network Fundamentals
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.0 OSI Transport Layer Network Fundamentals – Chapter 4.
A CHAT CLIENT-SERVER MODULE IN JAVA BY MAHTAB M HUSSAIN MAYANK MOHAN ISE 582 FALL 2003 PROJECT.
Inter Process Communication:  It is an essential aspect of process management. By allowing processes to communicate with each other: 1.We can synchronize.
© Lethbridge/Laganière 2001 Chap. 3: Basing Development on Reusable Technology 1 Let’s get started. Let’s start by selecting an architecture from among.
Fundamentals of Python: From First Programs Through Data Structures
Process-to-Process Delivery:
CS252: Systems Programming Ninghui Li Final Exam Review.
TCP/IP protocols Communication over Internet is mostly TCP/IP (Transmission Control Protocol over Internet Protocol) TCP/IP "stack" is software which allows.
70-291: MCSE Guide to Managing a Microsoft Windows Server 2003 Network Chapter 3: TCP/IP Architecture.
ISO Layer Model Lecture 9 October 16, The Need for Protocols Multiple hardware platforms need to have the ability to communicate. Writing communications.
1 Computer Networks DA Chapter 1-3 Introduction.
Lector: Aliyev H.U. Lecture №6 Design of client-server communication software. TCP-based network programming TASHKENT UNIVERSITY OF INFORMATION TECHNOLOGIES.
Jozef Goetz, Application Layer PART VI Jozef Goetz, Position of application layer The application layer enables the user, whether human.
Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 17 This presentation © 2004, MacAvon Media Productions Multimedia and Networks.
Multi-Threaded Application CSNB534 Asma Shakil. Overview Software applications employ a strategy called multi- threaded programming to split tasks into.
University of the Western Cape Chapter 12: The Transport Layer.
Chapter 6-2 the TCP/IP Layers. The four layers of the TCP/IP model are listed in Table 6-2. The layers are The four layers of the TCP/IP model are listed.
111 © 2002, Cisco Systems, Inc. All rights reserved.
1 Web Based Programming Section 8 James King 12 August 2003.
Fundamentals of Proxying. Proxy Server Fundamentals  Proxy simply means acting on someone other’s behalf  A Proxy acts on behalf of the client or user.
Chapter 15 – Part 2 Networks The Internal Operating System The Architecture of Computer Hardware and Systems Software: An Information Technology Approach.
Threads & Networking C# offers facilities for multi threading and network programming an application roughly corresponds to a process, handled by the OS.
12/5/2015.net 1 system.net Contains any network functionallity you would need in c# Several sub namespaces exists to allow for more fined control –System.Net.Sockets.
15.1 Threads and Multi- threading Understanding threads and multi-threading In general, modern computers perform one task at a time It is often.
The Client-Server Model And the Socket API. Client-Server (1) The datagram service does not require cooperation between the peer applications but such.
Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 17 This presentation © 2004, MacAvon Media Productions Multimedia and Networks.
Networking OSI (Open Systems Interconnection) model of computer networking, seven layers (the Application, Presentation, Session, Transport, Network, Data.
Transmission Control Protocol (TCP) BSAD 146 Dave Novak Sources: Network+ Guide to Networks, Dean 2013.
UNIT-6. Basics of Networking TCP/IP Sockets Simple Client Server program Multiple clients Sending file from Server to Client Parallel search server.
CS533 - Concepts of Operating Systems 1 Threads, Events, and Reactive Objects - Alan West.
Data Communications and Networks Chapter 6 – IP, UDP and TCP ICT-BVF8.1- Data Communications and Network Trainer: Dr. Abbes Sebihi.
McGraw-Hill Chapter 23 Process-to-Process Delivery: UDP, TCP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
TCP/IP1 Address Resolution Protocol Internet uses IP address to recognize a computer. But IP address needs to be translated to physical address (NIC).
How Do Users Share Computer Files?
Chapter 11 User Datagram Protocol
Chapter 9: Transport Layer
Instructor Materials Chapter 6: Quality of Service
Instructor Materials Chapter 9: Transport Layer
Multi Threading.
Sockets and Beginning Network Programming
Computing with C# and the .NET Framework
Internet Networking recitation #12
NET323 D: Network Protocols
Internet Control Message Protocol Version 4 (ICMPv4)
Multimedia and Networks
NET323 D: Network Protocols
Process-to-Process Delivery:
Threading And Parallel Programming Constructs
Multithreading.
Networking Theory (part 2)
Threaded Programming in Python
William Stallings Data and Computer Communications
.Net Sockets.
PART 5 Transport Layer.
NETWORK PROGRAMMING CNET 441
Multi-routing the '.Net' Gigax, Kevin Edward Torres, Francisco Javier
Computer Networks DA2402.
Process-to-Process Delivery: UDP, TCP
Computer Networks Protocols
Jim Fawcett CSE681 – Software Modeling & Analysis Fall 2008
Clients and Servers 19-Jul-19.
Clients and Servers 13-Sep-19.
Transport Layer 9/22/2019.
Exceptions and networking
Java Chapter 3 (Estifanos Tilahun Mihret--Tech with Estif)
Jim Fawcett CSE681 – Software Modeling & Analysis Fall 2008
Jim Fawcett CSE681 – Software Modeling & Analysis Fall 2008
Networking Theory (part 2)
Presentation transcript:

Multi-routing the '.Net' Gigax, Kevin Edward Torres, Francisco Javier CS522 – Computer Communications 12/28/2018

Project Goals The Goal of this project is to enable multi-routing in a Microsoft .NET environment using the C# language. The projects initial phase is to implement multi-routing using routes that are hard-coded into the servers. In the future, the project plans to implement multi-routing to any server running the .NET framework. 12/28/2018

Description The project calculates the bandwidth from a source server through n different routes to a destination server. The project will be expanded to route through multiple servers in the future. 12/28/2018

Function Call: getBandwidth Finds the fastest route from S1 to D1 using specific servers R1 S1 R2 D1 Rn 12/28/2018

Function Call: getBandwidth2 Finds the fastest route from S1 to D1 using x amount of servers R12 R13 R11 S1 D1 R21 R22 Rn1 Rnn 12/28/2018

Implementation The software design uses a software created packet of x bytes. This packet is transmitted across the network using a socket connection as an ICMP packet. The software times the amount of time for the packet to be transmitted and for a reply to be received. This timing is the estimated bandwidth of that route. The routers are hard-coded into the servers as character arrays. Each router in the array is tested for its bandwidth abilities. 12/28/2018

Implementation Function Calls getBandwidth(sourceServer, destinationServer, routingServer) For each proxy server available, call getBandwidth function Once an acceptable bandwidth is found exit call and use this proxy server findBandwidth(sourceServer, destinationServer) Execute a packet send and receive to the source and to the destination Time the packet’s total round trip time 12/28/2018

Drawbacks The primary drawbacks of the project are as follows: Congesting the network: if we continual send out queries for bandwidth, we start to cause serious network congestion Estimated Bandwidth: available bandwidth is a large topic and we cannot insure that this is the best way to find the bandwidth of a connection 12/28/2018

Performance Analysis Waiting for multiple queries highly degrades performance: We need to implement multi-threaded queries to solve this Getting the absolute best bandwidth can also degrade performance We can set an acceptable bandwidth value and stop the queries once we find a bandwidth that is >= to this value 12/28/2018

Socket connections in .NET How to create both ends of a TCP/IP socket connection between two or more applications? 12/28/2018

Sequence of events 12/28/2018

Why use sockets in .NET? .NET uses sockets in many instances as Web services and remoting, but here the low level stuff is done for us. However, when interfacing with other non .NET system, sockets are a necessary and simple communication method. 12/28/2018

Why use Stream Sockets? Stream Sockets (TCP) Session (or connection) based service Guarantees that packets are sent without errors, sent (and received) in sequence and without duplication Unlimited data size in packets Communication between server and client occurs through streams The base class for this communication is NetworkStream . Streams can be used for binary, text, and string data or serialized objects. Datagram sockets are supported by class System.Net.Sockets.UDPClient 12/28/2018

Scenario for Stream Sockets Sockets are created by both client and server, Server specifies a port number Server may customize aspects of connections (wait queue, etc) Client specifies the internet address and port in creating its socket. In C#, when the client creates its TCPClient instance, a connection is established with the TCPListener 12/28/2018

Scenario… (continued) Server listens for arriving requests ( AcceptSocket or AcceptTcpClient method) to establish a session (connection) with a client. If no connections are pending, the server blocks . If one or more clients are waiting, they are queued and in turn, the server creates a new thread (stay tuned) to service each client. The parent thread re-issues the accept to service another client on the same socket. The client and server identify input and output streams for passing information according to a protocol they both agree to. The input and output streams perform the work of the application. The client and server must both close the connection to allow resources to be used in another connection. 12/28/2018

.NET sample socket Client and Server 12/28/2018

Socket Server: using System.Net.Sockets; using System; /// <summary> /// Example program showing simple TCP socket connections in C#.NET. /// TCPSocketServer is the socket server. /// </summary> public class TCPSocketServer { public static void Main (string [] args) { TcpListener tcpl = new TcpListener(9090); tcpl.Start(); Console.Write("TCPSocketServer up and waiting for connections on 9090"); Socket sock = tcpl.AcceptSocket(); string msg = "Hello Client"; Byte[] msgBytes = System.Text.Encoding.ASCII.GetBytes(msg); sock.Send(msgBytes, msgBytes.Length, SocketFlags.DontRoute); tcpl.Stop(); sock.Close(); } 12/28/2018

Socket Client: using System; using System.IO; using System.Windows.Forms; using System.Net.Sockets; /// <summary> /// Example program showing simple TCP socket connections in C#.NET. /// TCPSocketClient is the socket client. /// </summary> public class TCPSocketClient { public static void Main (string[] args) { TcpClient tcpc = new TcpClient("localhost", 9090); Stream tcpStream = tcpc.GetStream(); StreamReader reader = new StreamReader(tcpStream, System.Text.Encoding.ASCII); MessageBox.Show(reader.ReadLine()); reader.Close(); tcpc.Close(); } 12/28/2018

Thread Concept Why threads? 12/28/2018

Threaded Socket Servers How does a threaded socket server, for protocols such as http or ftp, allow multiple clients to be simultaneously connected to the server? 12/28/2018

A thread is a single sequential flow of control within a program What is a Thread? A thread is a single sequential flow of control within a program A multi-threaded program Two or more threads seemingly active simultaneously All within the overhead of a single executing C# program A single starting point and ending point for all threads in the program and for the program itself. 12/28/2018

Other Threading capabilities: Thread.Join() method - used to wait for another thread to complete. Sleep -- suspend for a number of milliseconds Thread.Sleep(2000) ; Thread States ; Thread includes a property to query a state. Priorities - .NET supports 1 to 10 lowest to highest priorities Volatile modifier for attributes (don't cache) multi-CPU one RAM. 12/28/2018

Synchronization. What is a Shared Object ? Multiple threads of single program may access or change the same object. When should access to shared objects be controlled ? When multiple threads only read the object - no synchronization . If any thread modifies the object - synchronization is necessary. Why must access be controlled when some thread changes the object? consider: stack.push(item) , for example multiple actions are necessary to achieve consistent state, for example: (1) increment stack pointer; (2) place the new item into the collection using the stack pointer. If one thread is interrupted after step 1, but before step 2 , then another thread may see an inconsistent stack state (visualize a = stack.top() ). Monitor - a lock used to protect a critical section of code Each thread calls Enter() to get the lock before push(item) Each thread calls Exit() to release the lock after push(item) completes 12/28/2018

C# .NET Monitors A Monitor protects access to the Object See System.Threading.Monitor class All Monitor methods are static Basic Monitor methods to lock and unlock an object void Enter(object) and bool TryEnter(object, TimeSpan) lock the object. A thread may be recursive (call multiple Enter's before first Exit) void Exit(object) indicate the calling thread is ready to unlock the object 12/28/2018

Issues with Multi-Threaded programs: Synchronization - "I can't go past this statement until another thread reaches that statement" Concurrency , parallelism and asynchronous behavior Deadlock Threads with shared data (objects) Scheduling and blocking operations, such as input and output Underlying support for implementing threads Performance 12/28/2018

Overview 12/28/2018

Conclusions Our project progress has reached being able to calculate a path from a source to destination server using socket connections when the routing servers are hard-coded Our continued efforts involve creating actual packets and headers to relay through multiple paths to increase throughput and researching algorithms that locate ‘good’ paths through the internet to a destination server 12/28/2018

What is next? Find a proper way to calculate the bandwidth. A specific design of threads, server, clients, frame’s headers. Design a bidirectional communication, in order to implement a multimedia (voice and sound) application. 12/28/2018

References VisualC Ideas: Using Sockets in C# http://www.mctainsh.com/Csharp/SocketsInCS.aspx Stream Sockets in C#.NET http://pooh.east.asu.edu/Cet556/ClassNotes/Serial/cnSerialThreadSocket-18.html The Code Project http://www.codeproject.com/csharp/workerthread.asp Programing with threads in C# http://pooh.east.asu.edu/Cet556/ClassNotes/Serial/cnSerialThreadSocket-25.html O'Reilly Network: Multithreading with C# http://www.ondotnet.com/pub/a/dotnet/2001/08/06/csharp.html C# Primer – A Practical Approach Stanley B. Lippman, Addison-Wesley, 2002 Pearson Education C# Essentials Ben Albahari, Peter Drayton & Brad Merril, 2002 O’Reilly 12/28/2018