---
title: "FTP-Buffer vs. rxbuff / txbuff"
url: "https://maker.wiznet.io/forum/12253"
markdown_url: "https://maker.wiznet.io/forum/12253/md"
type: "Forum topic"
category: "General"
author: "kschwi"
created: "2017-04-22T16:57:53+09:00"
last_activity: "2017-09-07T08:50:51+09:00"
language: "en"
views: 1280
replies: 5
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# FTP-Buffer vs. rxbuff / txbuff

## Question

Asked by kschwi on 2017-04-22 in General.

Hi,

as described before I’m running the Wiz550web-SW on a CPU with little RAM. I understand that you separated the FTP Buffer (FTP_DBUF) from the WEB-buffers. Is there any reason to have the separate or could I use the Web-buffers for FTP too?

Cheers,
Knut

## Replies

### Reply 1 by Kei, 2017-04-25

Hi,

Are you currently customizing?
If you do not have enough RAM, you can modify it as you like.
Since FTP and data communication are not performed at the same time, there is no big problem.

Best regard,
Kei.

### Reply 2 by kschwi, 2017-09-05 (in reply to reply 1)

Hi Kei,

I checked the usage of the Web-Buffers for ftp. After entering the password I received a 404 from the Web-Server. I think the problem is based on socknumlist. If ftp is enabled the first 4 entries (sockets) 2, 3,4, 5 are used. In ftpd.h CTRL_SOCK is defined as 2 and DATA_SOCK is defined as 3. This means 2 Web-Sockets are used for ftp, but the sockets 6 and 7 are unused. Are you sure this is a wanted implementation?

Cheers,
Knut

### Reply 3 by Kei, 2017-09-06

![](https://avatars.discourse-cdn.com/v4/letter/k/f19dbf/48.png) kschwi:

> This means 2 Web-Sockets are used for ftp

Are you asking why we use two sockets for FTP?

If so, a FTP use two sockets for FTP because we use Data and Control in FTP protocol.
Please see the [RFC 959](https://www.w3.org/Protocols/rfc959/) for this.

![](https://avatars.discourse-cdn.com/v4/letter/k/f19dbf/48.png) kschwi:

> but the sockets 6 and 7 are unused.

As you can see in the code, the code uses two sockets for FTP, one for DHCP, and one for DNS.
So, to use 2, 3, 4, 5 as the socket for http communication, you have to change the above four socket numbers.

![](https://avatars.discourse-cdn.com/v4/letter/k/f19dbf/48.png) kschwi:

> Are you sure this is a wanted implementation?

Unfortunately, the code is written by another developer, so it’s difficult to tell the exact intent.

### Reply 4 by irina, 2017-09-06

If you want to run FTP and Web server at the same time, it is better to allocate a hardware socket as follows.

- Configuration tool / DHCP: Socket 0, 1

- FTP Server: Socket 2, 3 (fixed)

- Web Server: Socket 4, 5, 6, 7

Incidentally, the Web Server process requires one TCP connection per link (e.g., image file) of a web page, so it is a good idea to allocate as many hardware sockets as possible.

![](https://avatars.discourse-cdn.com/v4/letter/k/f19dbf/48.png) kschwi:

> but the sockets 6 and 7 are unused. Are you sure this is a wanted implementation?

In the main code of Github repository of WIZ550web product, sockets are defined as follows.

```
#define SOCK_CONFIG		0
#define SOCK_DHCP		1
#if defined(F_APP_FTP)
uint8_t socknumlist[] = {4, 5, 6, 7};
#else
uint8_t socknumlist[] = {2, 3, 4, 5, 6, 7};
#endif
```

### Reply 5 by kschwi, 2017-09-06 (in reply to reply 4)

Sorry for the noise, I’d copied the only the complete socknumlist from main.c and forgot to copy the ftp-version of socknumlist.

Thanks for the quick check.

Cheers,
Knut

---

Source: https://maker.wiznet.io/forum/12253
