-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
171 lines (122 loc) · 5.77 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
_____________________
| Andrew Lee |
| Subash Chebolu |
| CSE5462 Project 1|
| 09-11-16 README |
| Updated: 10-20-16 |
|___________________|
___________________
PROGRAM DESCRIPTION
___________________
Using everything built so far Project 1 focuses on creating a fully
functional file transfer protocal using udp. We are to attempting to
create everything from a timing system to figure out when to send
packets as well as acknowledgements to make sure that the packet were
received correctly.
====| ftps.c |=====================================================
ftps.c contains the server code
for recieving the file to be transfered and writing it to a local
folder "recvd". The main changes were, as described above,
replacing the bind, socket, send, and recv with BIND, SOCKET,
SEND, and RECV which are user defined functions described in
tcpapi.c. Once started, ftps.c will request a certain number of
bytes from tcpds.
====| ftpc.c |=====================================================
ftpc.c contains the client code for
sending a local file, across the network
(tcpdc -> Troll -> tcpds -> ftps)
where it will be written to a new file by ftps.c. Like ftps.c,
the main changes involved changing the bind, socket, send and recv
with our user defined tcpapi.c functions BIND, SOCKET, SEND, and
RECV. Once started with the proper parameters, ftpc.c will attempt
to send a file through the network to the given server socket.
====| tcpapi.c |==================================================
Same as for Lab03 it is our library file that contains the new
methods that are responsible for the creation of sockets and
sending of packets. The following functions are described in
srbaclib.c:
SEND - Converts the TCP send() to the UDP sendto()
RECV - Converts the TCP recv() to the UDP recvfrom()
BIND - Identical to bind() but assigns dest_addr
ACCEPT - No functionality for Project 1
CONNECT - No functionality for Project 1
SOCKET - Identical to socket()
====| tcpapi.h |==================================================
Header file that contains the function definitions for srbaclib.c
====| tcpds.c |===================================================
Contains the methods for receiving data from the ftps.c server that
includes
1) The fact that the server is ready to recieve the file
2) The size of the buffer it is expecting
It is responsible for recieving the packets from tcpdc.c and
forwarding them to ftps.c where it will construct the recieved file.
====| tcpdc.c |===================================================
Contains the methods for sending packets from ftpc.c to the Troll
which, acting like a network will forward them to the given address
which is the tcpds.c.
====| Makefile |==================================================
Contains the command line arguements for compiling and cleaning the
Project 1 files.
====| crc32.c |==================================================
File that contains code borrowed (more details in file) from the
internet for doing checksumming so that garbled packets can be
found and dealt with
====| crc32.h |==================================================
File that contains the headers and function signatures for
functions in crc32.c
====| sbuffer.h |================================================
Header file that contains relevent methods needed in ftps that
pertain to the server circular buffer implementation, sbuffer.c
====| sbuffer.c |================================================
Contains the implementation for the circular server buffer used
to store data. Implementation involves using a linked list to
maintain circular buffer.
====| cbuffer.h |================================================
Header file that contains relevent methods needed in ftpc that
pertain to the client circular buffer implementation, cbuffer.c
====| cbuffer.c |================================================
Contains the implementation for the circular client buffer used
to store data. Implementation involves using a linked list to
maintain circular buffer.
====| timerprocess.c |===========================================
Contains the logic and methods creating, maintaining, and printing
the linked list containing the timers for packets. Interacted via
timerDEMO.c which sends packets of 4 bytes that includes a flag
byte (1 = Insert, 2 = Remove, 3 = Quit), a byteSeqNum byte, and 2
bytes containging two ints that represent the double time value.
====| timerDEMO.c |==============================================
Contains the logic and hardcoded timer starting and canceling logic.
Interacts with timerproccess.c via starttimer(), canceltimer() and
quittimer();
___________________
Running Instruction
___________________
====| File Transfer |=============================================
To successfully execute a file transfer using Project 1, one must
complete the following steps. Note: cM = Client Machine
sM = Server Machine
1) Compile the code by executing:
| $ make clean
| $ make
2) Run tcpds and tcpdc by executing in multiple terminals/machines
| sM$ tcpds <client-IP>
| cM$ tcpdc <server-IP>
3) Run troll by executing on the client machine
| cM$ troll -t -x 0 -s 0 <local-PORT>(4000)
4) Run timerprocess by executing on the client maching
| cM$ tp
4) Run ftps by executing the following on the server machine
| sM$ ftps <server-PORT>
5) Run ftpc by executing the following on the client machine
| cM$ ftpc <local-file-to-transfer>
====| Timer Demo |================================================
To successfully execute a timer demo using Project 1, one must
complete the following steps. Note: cM = Client Machine
sM = Server Machine
1) Compile the code by executing:
| $ make clean
| $ make
2) Run tp by executing in a terminal
| sM$ tp <local-port>
3) Run td by executing in a terminal
| cM$ td <remote-ip> <remote-port>