Skip to content
This repository has been archived by the owner on Sep 9, 2021. It is now read-only.

Белов Егор, 3530901/70201 lab2s #34

Closed
wants to merge 6 commits into from

Conversation

EgoriusE
Copy link

Лаб. 2 сервер
Описание см. readme

@EgoriusE EgoriusE changed the title Белов Егор, 3530901/70201 Белов Егор, 3530901/70201 lab2s Nov 29, 2020
@wrbbz wrbbz added the Вторая лабораторная Реальные UDP протоколы label Nov 30, 2020
@wrbbz
Copy link
Contributor

wrbbz commented Jan 10, 2021

Попытки загрузки и выгрузки файла на/с сервер(а) не привели к успеху:

Загрузка файла на сервер:

Клиент:

➜ atftp 167.99.132.136 1820
tftp> put intertwined
timeout: retrying...
timeout: retrying...
^Ctftp: unknown error.
tftp: aborting

Сервер:

ke@ubuntu-s-1vcpu-1gb-fra1-01:~/2020H2/src$ java tftp --host 167.99.132.136 -p 1820
Server Ready. Address: 167.99.132.136 Port: 1820
Write Request from /91.108.28.40
Time out, resend ack
Time out, resend ack
Time out, resend ack
Time out, resend ack
Write Request from /91.108.28.40
Client start failed:access violation, file exists
Time out, resend ack
Client failed:  Connection failed
Write Request from /91.108.28.40
Time out, resend ack
Time out, resend ack
Time out, resend ack
Time out, resend ack
Time out, resend ack
Client failed:  Connection failed

Выгрузка файла:

Клиент:

➜ atftp 167.99.132.136 1820
tftp> get test.txt
timeout: retrying...
timeout: retrying...
^Ctftp: unknown error.
tftp: aborting

Сервер:

ke@ubuntu-s-1vcpu-1gb-fra1-01:~/2020H2/src$ java tftp --host 167.99.132.136 -p 1820
Server Ready. Address: 167.99.132.136 Port: 1820
Read Request from /91.108.28.40
procce checking
send block no. 1
bytes sent:  516
current op code  3
Resent blk 1
Resent blk 1
Resent blk 1
Resent blk 1
Read Request from /91.108.28.40
procce checking
send block no. 1
bytes sent:  516
current op code  3
Resent blk 1
Client failed:  connection failed
Resent blk 1
Resent blk 1
Resent blk 1
Resent blk 1
Read Request from /91.108.28.40
procce checking
send block no. 1
bytes sent:  516
current op code  3
Resent blk 1
Client failed:  connection failed
Resent blk 1
Resent blk 1
Resent blk 1
Resent blk 1
Resent blk 1
Client failed:  connection failed

@EgoriusE
Copy link
Author

EgoriusE commented Jan 14, 2021

Никак не получается воспроизвести.. может есть еще какие нибудь детали?
Провел повторное тестирование на windows и linux:
Windows:
Клиент:

C:\Users\egori>tftp -i 127.0.0.1 get pic.jpg
Успешная передача: 9934 байт за 1 сек., 9934 байт/с

C:\Users\egori>tftp -i 127.0.0.1 put .gitconfig
Успешная передача: 103 байт за 1 сек., 103 байт/с

Сервер

D:\Projects\Java\2020H2\src>java tftp
Server Ready. Address: 127.0.0.1 Port: 69
Read Request from /127.0.0.1
procce checking
send block no. 1
bytes sent:  516
current op code  3
confirm blk num 1 from 57852
send block no. 2
bytes sent:  516
<...>
confirm blk num 19 from 57852
send block no. 20
bytes sent:  210
current op code  3
confirm blk num 20 from 57852
Transfer completed.(Client /127.0.0.1)
Filename: pic.jpg
SHA1 checksum: 720a392b77c2bed1995cacf01034aa45b0f3f90f

Write Request from /127.0.0.1
Transfer completed.(Client /127.0.0.1)
Filename: .gitconfig
SHA1 checksum: a8b89f3971145245a570e46b8e1119cb0fbe8272

Linux:
клиент:

egorius@DESKTOP-DG9NQ0F:~$ sudo tftp
tftp> connect 127.0.0.1
tftp> put testfile2
Sent 17 bytes in 0.0 seconds
tftp> get pic.jpg
Received 9934 bytes in 0.0 seconds

сервер:

egorius@DESKTOP-DG9NQ0F:~/tftp-server/src$ sudo java tftp
Server Ready. Address: 127.0.0.1 Port: 69
Write Request from /127.0.0.1
Transfer completed.(Client /127.0.0.1)
Filename: testfile2
SHA1 checksum: 31bc9d52e8b5d15c0b826a37a3bbc2cf55dca69b

Read Request from /127.0.0.1
procce checking
send block no. 1
bytes sent:  516
current op code  3
confirm blk num 1 from 61873
send block no. 2
bytes sent:  516
current op code  3
confirm blk num 2 from 61873
send block no. 3
bytes sent:  516
current op code  3
confirm blk num 3 from 61873
send block no. 4
bytes sent:  516
current op code  3
confirm blk num 4 from 61873
send block no. 5
bytes sent:  516
current op code  3
confirm blk num 5 from 61873
send block no. 6
bytes sent:  516
current op code  3
<...>
send block no. 19
bytes sent:  516
current op code  3
confirm blk num 19 from 61873
send block no. 20
bytes sent:  210
current op code  3
confirm blk num 20 from 61873
Transfer completed.(Client /127.0.0.1)
Filename: pic.jpg
SHA1 checksum: 720a392b77c2bed1995cacf01034aa45b0f3f90f

@wrbbz
Copy link
Contributor

wrbbz commented Jan 16, 2021

Воспроизводится в том случае, когда сервер и клиент находятся на разных машинах.
Локально - да. Все хорошо

@EgoriusE
Copy link
Author

Провел еще тестирования, теперь на разных машинах:

Если запускать мой сервер на windows и подключаться к нему с другой машины на линуксе, то все работает:
Клиент линукс

egorius@egor-pc:~/tfttp client/2020H2/src$ tftp
tftp> connect 192.168.0/103
192.168.0/103: unknown host
tftp> connect 192.168.0.103
tftp> get pic.jpg
Received 9934 bytes in 0.1 seconds
tftp> get pic.jpg
Received 9934 bytes in 0.1 seconds
tftp> quit
egorius@egor-pc:~/tfttp client/2020H2/src$ echo 'hello world smth' » test
egorius@egor-pc:~/tfttp client/2020H2/src$ tftp
tftp> connect 192.168.0.103
tftp> put test
Sent 18 bytes in 0.0 seconds
tftp>

Сервер windows:

D:\Projects\Java\2020H2\src>java tftp --host 192.168.0.103
Server Ready. Address: 192.168.0.103 Port: 69
Read Request from /192.168.0.106
procce checking
send block no. 1
bytes sent:  516
current op code  3
<...>
bytes sent:  210
current op code  3
confirm blk num 20 from 49388
Transfer completed.(Client /192.168.0.106)
Filename: pic.jpg
SHA1 checksum: 720a392b77c2bed1995cacf01034aa45b0f3f90f

Read Request from /192.168.0.106
procce checking
send block no. 1
bytes sent:  516
<...>
send block no. 20
bytes sent:  210
current op code  3
confirm blk num 20 from 58982
Transfer completed.(Client /192.168.0.106)
Filename: pic.jpg
SHA1 checksum: 720a392b77c2bed1995cacf01034aa45b0f3f90f

Write Request from /192.168.0.106
Transfer completed.(Client /192.168.0.106)
Filename: test
SHA1 checksum: db94c45efe004e27943eeea48801ff4a552cc30d

Пакеты отловленные в wireshark
image

НО если запускать сервер на линуксе (в моем случае ubuntu 18.04) и подключаться с другой машины - то не работает. Причем если подключаться к серверу локально на линуксе, то работает
Так и не смог найти причину

@wrbbz
Copy link
Contributor

wrbbz commented Jan 18, 2021

Да. В этом и была проблема. Локально рабоотало, при связи Линукс-Линукс - нет. Но, судя по пакетам из Wireshark все ок. Так что: зачет

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Вторая лабораторная Реальные UDP протоколы Зачтено
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants