That depends on where your routes are going. Since I almost always use external trade routes, I usually beeline to ecology at start of game, and build the fence fast. Usually for internal routes, the fence is not needed, unless your cities are spread apart, and even then, you could just place a soldier in between your cities where the route is going.
If you did not start your game with Pioneering already researched, then it's probably not worth using external trade routes, and probably a fence is not needed. In my most recent games, I start with pioneering, rush ecology as my first tech while I build a trade port, and only build trade vessels/convoys after I already built the fence (unless I Get 2nd city early, in which case I build a trade to it before finishing fence). So all in all, with all that, you could start using external trades as early as around turns 30 - 40s if all goes well.